如何强制C#条件指令的缩进?

前端之家收集整理的这篇文章主要介绍了如何强制C#条件指令的缩进?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是否有一个选项如何禁用#if,#endif和其他指令不会在编辑后修改 – >高级 – >在Visual Studio中格式化文档?

谢谢!

解决方法

看看 StyleCop.

StyleCop analyzes C# source code to enforce a set of style and consistency rules. It can be run from inside of Visual Studio or integrated into an MSBuild project. StyleCop has also been integrated into many third-party development tools.

您甚至可以添加自定义规则:Creating Custom Rules for Microsoft Source Analyzer

希望它有帮助.

猜你在找的C#相关文章