简体   繁体   English

Visual Studio 2017,重新打包-缩进

[英]Visual studio 2017, resharper - broken indentation

For whatever reason the line indentation broke for Visual Studio for me, but only for .NET Core projects (any other projects have correct setup). 无论出于何种原因,行缩进对于我的Visual Studio而言都是无效的,但仅适用于.NET Core项目(任何其他项目均具有正确的设置)。 No matter what I put in the settings its always 2 spaces even though scaffolded components still get generated with 4. 不管我在设置中放什么,它总是2个空格,即使脚手架组件仍然是用4生成的。

Which ends up with: 最终以:

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

I also tried changing it in resharper but it also doesn't seem to work. 我也尝试过重新修改它,但它似乎也不起作用。

转载器窗口

This is literally driving me nuts. 从字面上看,这真让我发疯。 Anyone else had this? 还有其他人吗?

If you encounter this issue, in my case it was .editorconfig file that had settings, which were overriding the configuration of both visual studio, and resharper. 如果遇到此问题,就我而言,是具有设置的.editorconfig文件,该设置将覆盖Visual Studio和Resharper的配置。 The file can be localized either in your solution folder, or more often in the folder which contains your package.json if you're using any framework like angular for your frontend. 该文件可以本地化在解决方案文件夹中,或者如果在前端使用angular这样的框架,则可以在包含package.json的文件夹中进行本地化。

# 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

This has already been reported to Microsoft by other developers but they don't consider it a bug. 其他开发人员已经向Microsoft报告了此错误,但他们并不认为这是错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM