Jeroen
Jeroen

Reputation: 63749

Per solution new line options for braces in Visual Studio 2017

Through this answer to a question on per-solution indentation settings for Visual Studio I found out that the EditorConfig format is supported for VS 2017.

What I cannot find is how to use EditorConfig (or failing that: any alternative) to set "New line options for braces" on a per-solution basis.

Here's the relevant settings from Visual Studio:

new lines for braces settings dialog

These settings are persisted on my Visual Studio 2017 account, which is really annoying since I use defaults for my pet projects, but the project I mainly work on uses Egyptian braces style. If I change these settings on my work PC they will be synched to my home PC every time, and vice versa.

Can EditorConfig be used to have per-solution settings for "New line options for braces"? Failing that, is there another way to handle this?

Upvotes: 1

Views: 989

Answers (1)

Brian Reichle
Brian Reichle

Reputation: 2856

I believe these are controlled by the csharp_new_line_before_open_brace property in .editorconfig. Unfortunately the closest thing I have seen to documentation on the properties used by roslyn is the source code and the issue under which they were added.

My experience with getting visual studio to use a .editorconfig file however, has been a bit hit and miss. Sometimes visual studio will ignore the file without giving any reason.

Upvotes: 2

Related Questions