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

Your email address will not be published. Required fields are marked *

You May Also Like

Do you want to hide the start page in Microsoft Visual Studio 2012 within few simple steps? Here we go....
DataTip is a feature in Visual Studio that provides the users an easy way to view information about variables used...
Today, when I was trying to install the Team Foundation Server (TFS) Power Tools 2013, I received an error “The...