Visual Studio, per solution indentation settings

Fire Lancer picture Fire Lancer · Jul 31, 2009 · Viewed 21.3k times · Source

I'm working on a couple of different things and some use tabs, some use 2 spaces for indents, another users 4 spaces for indents etc.

The option to set this in Visual Studio is in Tools->Options->Text Editor-><language>->Tabs

Is there some way to override these settings on a per solution bases?

Answer

Tereza Tomcova picture Tereza Tomcova · Jul 12, 2012

UPDATE: VS 2017 supports EditorConfig natively: https://blogs.msdn.microsoft.com/dotnet/2016/12/15/code-style-configuration-in-the-vs2017-rc-update/

In VS 2010 and above, there's an extension that sets the indentation based on .editorconfig file in the solution/project root:

http://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328

There's also similar extension for Visual Studio Code.