Visual studio 2017,resharper - 损坏的缩进

Visual studio 2017, resharper - broken indentation

无论出于何种原因,行缩进对我来说 Visual Studio 中断,但仅适用于 .NET Core 项目(任何其他项目都有正确的设置)。无论我在设置中放置什么,它总是 2 个空格,即使脚手架组件仍然生成 4 个空格。

最后是:

public SomeClass 
{
public Guid Id { get; set; }
}

我也试过在 resharper 中更改它,但它似乎也不起作用。

这简直让我抓狂。还有其他人有这个吗?

如果您遇到这个问题,在我的例子中是 .editorconfig 文件有设置,这些设置覆盖了 visual studio 和 resharper 的配置。该文件可以本地化在您的解决方案文件夹中,或者更常见的是在包含您的 package.json 的文件夹中,如果您正在为您的前端使用 angular 之类的任何框架。

# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false

其他开发人员已将此报告给 Microsoft,但他们不认为这是一个错误。