在我的公司,我们使用的是VS 2010专业版,它不支持内置的源代码分析。所以我使用 FxCop 10 来解决这个问题。我们的客户端开发团队正在使用VS 2010 Ultimate,其中内置了SCA,并且在某些项目中很少有SCA警告被视为错误。现在我从 FxCop 收到一些警告,如下所示,
Warning: Unrecognized rule 'Microsoft.Globalization/CA1303:Do not pass literals as localized parameters'.
Warning: Unrecognized rule'Microsoft.Globalization/CA1303'.
我不知道如何使 FxCop 识别这些警告。
搜索后我发现它是 由新型规则引擎 PhoenixAnalysis 实现,它没有随 FxCop 独立版一起提供,我在 Visual Studio 2010 FxCop 文件夹中找到了它。我将 PhoenixAnalysis.dll 复制到 FxCop 10 引擎文件夹,但它不起作用。
有什么解决方法,我可以使用 PhoenixAnalysis 或识别全球化警告吗?
In my company we are using VS 2010 Professional edition, which doesn't support Source code analysis in built. So I am using FxCop 10 to resolve this issue. Our client side developer team is using VS 2010 ultimate, in which SCA is inbuilt and few of the SCA warning treated as errors in some projects. Now I am getting some warnings from FxCop like this
Warning: Unrecognized rule 'Microsoft.Globalization/CA1303:Do not pass literals as localized parameters'.
Warning: Unrecognized rule'Microsoft.Globalization/CA1303'.
I don't know how to enable FxCop to recognize these warnings.
After searching I found it is implemented by new kind of rule engine PhoenixAnalysis, it was not shipping with FxCop standalone, I found it in the Visual Studio 2010 FxCop folder. I copied the PhoenixAnalysis.dll to FxCop 10 engines folder, but it is not working.
Is there any workaround, I can use PhoenixAnalysis or recognize globalization warnings?
发布评论
评论(1)
Phoenix 引擎和数据流规则仅获得 VS 2010 Premium 和 Ultimate 的许可,因此这种解决方法可能会违反您的许可协议。
如果您的目的只是为了避免由于 SuppressMessageAttribute 实例引用 FxCop 无法识别的规则而产生的警告,您可能需要考虑使用某些 StyleCop 用户使用的相同解决方法:创建一个虚拟 FxCop 规则程序集,其中包含匹配的空规则缺少规则的签名。
The Phoenix engine and dataflow rules are only licensed with VS 2010 Premium and Ultimate, so such a workaround would presumably violate your license agreement.
If your intent is simply to avoid the warnings due to SuppressMessageAttribute instances that refer to rules that FxCop does not recognize, you might want to consider using the same workaround used by some StyleCop users: create a dummy FxCop rule assembly that includes empty rules that match the signature of the missing rules.