使用Microsoft All Rules设置启用代码分析后,构建失败 [英] Build failed after enabling Code Analysis with Microsoft All Rules set

查看:67
本文介绍了使用Microsoft All Rules设置启用代码分析后,构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个没有代码分析的旧项目。现在,我已经启用了代码分析规则集上的Microsoft All规则,启用了处理警告为错误和已启用抑制生成代码的结果。 

I am working on a old project developed without code analysis. Now I have enabled the Microsoft All rules on the rules set of Code Analysis, Enabled the treat warning as Error and Enabled Suppress results from generated code. 

我已构建解决方案并获得如此多的警告和错误我在GlobalSuppressionFile.cs和Source文件中都将它们全部压缩了。

I have build the solution and got so many warning and errors I suppressed them all in GlobalSuppressionFile.cs and in Source file too.

现在我们在为解决方案构建队列时出现问题我们从源文件中得到错误我们在源文件中禁止了警告。 

Now here problem arises when we build a queue for the solution we get the error from the source file where we have suppressed the warning in source file. 

稍后我们将Microsoft All规则更改为Microsoft基本正确性规则,并禁用项目的代码分析,然后对构建进行排队但仍然无法建立。 

Later we changed the Microsoft All rules to the Microsoft basic correctness rules and also disable the code analysis for the project and then queue a build but still not able to build. 

推荐答案

您好Srivastava Amar,

Hi Srivastava Amar,

谢谢在这里发布。

对于您的问题,如何为解决方案构建队列?

For your question, how do you build a queue for the solution?

如果您的应用程序是C#应用程序,则禁用代码分析,请尝试使用Microsoft Ma naged规则集的推荐规则。修复错误,然后构建应用程序。

If your application is C# application, when you disable the code analysis, please try to use Microsoft Managed Recommended Rules for the rule set. Fix the errors and then build the application.

最好的问候,

Wendy


这篇关于使用Microsoft All Rules设置启用代码分析后,构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆