阻止Visual Studio 2013自动删除分配中的额外空格

我正在尝试对齐某些赋值以提高可读性,但每次粘贴时,Visual Studio 2013会自动删除=之前的额外空格。

例如,这个:

 static class Constants { public static string Something = "A value"; public static string SomethingElse = "Another value"; } 

像这样重新格式化:

 static class Constants { public static string Something = "A value"; public static string SomethingElse = "Another value"; } 

有没有办法把它关掉?

可以通过“忽略声明语句中的空格”选项在Tools->Options->Text Editor->C#->Formatting->Spacing关闭它。

在此处输入图像描述

 VB.net for VisualStudio 2016 instructions: |<-- main menu bar -->|<------------Side Panel Of Options Window------>| Tools --> Options --> | Text Editor v | --> | Basic v | --> | Advanced | Options.Advanced window: ========================================================= = +----Highlighting-------------------------------+ = = | (...) | = = +-----------------------------------------------+ = = = = +----Outlining----------------------------------+ = = | (...) | = = +-----------------------------------------------+ = = = = +----Editor Help--------------------------------+ = = | | = = | [ ] Pretty listing (reformatting) of code | = = | | = = +-----------------------------------------------+ = ========================================================= 

截屏: 在此处输入图像描述