Code analysis warnings (IDExxxx) when building a .NET Framework project.

huangapple go评论71阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年8月4日 04:55:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76831554.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定