Visual studio 2017 .editorconfig在VS2017中不执行任何操作?

Visual studio 2017 .editorconfig在VS2017中不执行任何操作?,visual-studio-2017,editorconfig,Visual Studio 2017,Editorconfig,我有以下版本的visual studio: Microsoft Visual Studio Community 2017版本15.1(26403.7)发行版 VisualStudio.15.Release/15.1.0+26403.7 我创建了一个新项目,并在我的解决方案基础文件夹中添加了一个.editorconfig文件。 其内容如下: root = true [*.cs] indent_style = space:warning indent_size = 12:warning # CS

我有以下版本的visual studio:

Microsoft Visual Studio Community 2017版本15.1(26403.7)发行版 VisualStudio.15.Release/15.1.0+26403.7

我创建了一个新项目,并在我的解决方案基础文件夹中添加了一个
.editorconfig
文件。 其内容如下:

root = true

[*.cs]
indent_style = space:warning
indent_size = 12:warning

# CSharp and VisualBasic code style settings:
[{*.cs,*.vb}]
dotnet_style_qualification_for_field = false:warning
文件位置应正确:

.editorconfig <-- Here it is
ApplicationInsights.config
App_Data
App_Start
bin
Content
Controllers
favicon.ico
fonts
Global.asax
Global.asax.cs
Models
obj
packages.config
Properties
Scripts
Startup.cs
Views
Web.config
Web.config.backup.1
Web.Debug.config
Web.Release.config
WebApplication8.csproj
WebApplication8.csproj.user

.editorconfig我遇到了类似的问题,我就是这样解决的:

我的解决方案文件夹中有一个名为方括号
[]
的父文件夹,如下所示
[ParentFolderName]
,因此我删除了方括号,一切正常


出于某种原因或其他原因,当解决方案文件夹的父文件夹名位于方括号之间时,EditorConfiguration文件不会执行任何操作。IDE(在我的例子中是Visual Studio 2017)使用它的设置。

我解决了一个类似的问题,将.editorconfig放在项目的根文件夹中,即与.sln文件相同的文件夹中

  • 尝试将.editorconfig文件与源文件放在同一文件夹中。如果有帮助的话,试着将其向上移动(到父目录之一),直到您将其移动到足以影响所有需要的文件的高度
  • 如果已安装任何EditorConfig扩展,请尝试卸载它们。报告了一些相关的bug

  • 我也有同样的问题。在我的案例中,解决方案是将.editorconfig添加到解决方案中。您可以选择将其添加到解决方案或项目中,具体取决于您希望它应用于任何地方还是仅应用于单个项目


    解决方案资源管理器->右键单击您的解决方案/项目->添加->现有项。。。(如果在解决方案/项目的根目录下有.editorconfig文件)或新项。。。(然后在“添加新项目向导”中搜索编辑器配置,并为您的工作选择适当的类型)

    如果您使用“添加新项目向导”,它是否显示任何问题?不,它没有。您好@SergeBuSI,您是否已找到问题的解决方案?我发现此问题可能与您的问题有关:@SergeBuSI您找到此问题的解决方案了吗??我也有同样的问题