如何prevent的FxCop从分​​析自动生成的code? [英] How to prevent FxCop from analyzing auto-generated code?

查看:137
本文介绍了如何prevent的FxCop从分​​析自动生成的code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的FxCop(工具静态code分析)给了我一个错误,而检查的.edmx模型背后code。如何prevent的FxCop从分​​析自动生成的code(或至少是实体框架生成的类)?

FxCop (tool for static code analysis) gives me an error while checking code behind of .edmx model. How to prevent FxCop from analyzing auto-generated code (or at least Entity Framework generated classes)?

推荐答案

我已经转移到Visual Studio code分析,因为它给了我相同的功能的FxCop。

I have moved to Visual Studio Code Analysis, as it gives me the same functionality as FxCop.

的FxCop博客

这是正确的,他们是不同的产品(的FxCop和VS $ C C易观$),但他们有一个共同的引擎。的Visual Studio 2008 SP1已经自带了相同的修复和分析(以上加一点点),所以没有必要更新的Visual Studio与最新的FxCop。

"That's correct, they are different products (FxCop and VS Code Analysys), however they do have a common engine. Visual Studio 2008 SP1 already comes with the same fixes and analysis (plus a little bit more), so there is no need to 'update' Visual Studio with the latest FxCop."

但无论如何的从产生code燮preSS结果的选项(项目属性 - > code分析选项卡)由于某种原因,没有preventing从$ C $汽车C解析产生的.edmx模型code。

But nevertheless Suppress results from generated code option (project properties -> code analysis tab) for some reason does not preventing from code analysis for auto generated code of .edmx model.

然后我发现<一href="http://www.matthidinger.com/archive/2010/02/09/customizing-the-entity-framework-t4-template-sup$p$pssing-$c$c-analysis.aspx"相对=nofollow>博客,这帮助我解决这个问题。

Then I've found blog, which helped me solve this issue.

这篇关于如何prevent的FxCop从分​​析自动生成的code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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