schuess
schuess

Reputation: 1079

Replace tabs with spaces in Visual Studio project files (sln & vcproj)

I'm trying to have a strict no-tab policy at my company by adding blockers on commits which introduce tabs.

Problem is visual studio uses tabs for their .sln & .vcproj files even when your settings are set to use spaces instead of tabs in the VS editor.

Anyone know how I can change that or am I stuck making another microsoft exception?

Upvotes: 5

Views: 2542

Answers (2)

Toni
Toni

Reputation: 1585

This is fixed in Visual Studio 2019.

VS2019

Upvotes: 1

Jean-Michel Aubin
Jean-Michel Aubin

Reputation: 21

For your information, spaces are supported in vcxproj but not in sln files. Replacing tabs by spaces in .sln will make it load incorrectly (not generate exceptions or anything).

There are no settings in visual studio itself to change that though.

There are scripts that can do it before submitting in a source control but keep in mind that .sln files must keep the tabs to work correctly.

Upvotes: 2

Related Questions