英文:
Code analysis warnings (IDExxxx) when building a .NET Framework project
问题
我已在.editorconfig文件中启用了多个代码分析警告。Visual Studio向我显示了这些警告。但是,在构建时,生成输出中没有显示任何警告。在这里上说,你可以在.NET 5或更高版本中启用代码样式分析。是否有任何可能以某种方式在.NET Framework项目中启用它?
英文:
I have enabled several Code Analysis warnings in a .editorconfig file. Visual Studio shows me these warnings. However, when building, no warnings are shown in the build output. Here it says that you can enable the code-style analysis with .NET 5 or later. Is it in any way possible to enable it with a .NET Framework project?
答案1
得分: 2
你可以在这里中提到,添加一个对Microsoft.CodeAnalysis.CSharp.CodeStyle
的包引用,以使其显示在构建输出中。你不需要在项目文件中设置EnforceCodeStyleInBuild
。
英文:
As mentioned here, you can add a package reference to Microsoft.CodeAnalysis.CSharp.CodeStyle
to make it show up in the build output. You don't have to set EnforceCodeStyleInBuild
in the project file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论