HomeVisual StudioHow to disable Block on single Line in Visual Studio 2015.

How to disable Block on single Line in Visual Studio 2015.

When you create an auto property in Visual Studio 2015 , you will notice that it would be in a single line as shown below.

public int Name { get; set; }

When you use the shortcut for formatting in Visual Studio 2015 (Ctrl + K and Ctrl +D) , you will notice that the formatting would stay like the one shown in the above code.

There are times when you might want to have this formatting in multi-line instead of a single line. (I would prefer single line though :)).

How to Disable Block on single Line in Visual Studio 2015 ?

To change this behaviour , follow the below steps.

1. Launch Visual Studio 2015 and navigate to Tools -> Options.

2. In the Options Dialog left sidebar , select Text editor -> C# -> Formatting -> Wrapping and then uncheck the option “Leave block on single line”.

image

3. Click ok button and now apply the formatting. You should see the auto property in multi-line as shown below.

public string Name
{
    get; set;
}

Leave a Reply

You May Also Like

In this post, you’ll learn about the error code “SCC_E_BACKGROUNDGETINPROGRESS” returned by the Visual Studio when using the Source Control...
In this post, you’ll learn about the error code “SCC_E_UNKNOWNERROR” returned by the Visual Studio when using the Source Control...
In this post, you’ll learn about the error code “SCC_E_CONNECTIONFAILURE” returned by the Visual Studio when using the Source Control...