我只是在项目中添加FxCop规则集然后运行代码分析,我的项目失败了一些错误。其中一个主要错误是
I am just adding FxCop ruleset in my project and then run the code analysis, my project gets failed with some errors. one of the main error is
" MSBUILD:错误:CA0001:读取模块"MyProject"时遇到以下错误:无法解析类型引用: [System.Core,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089] System.Func`2。
"MSBUILD : error : CA0001 : The following error was encountered while reading module 'MyProject': Could not resolve type reference: [System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]System.Func`2."
运行代码分析时是否有可能解决错误?我在"Windows PowerShell"中运行我的项目。
Is there any possibility to resolve the errors while running the code analysis? I am running my project in "Windows PowerShell."
我也收到错误,如
"MSBUILD:错误:CA0001:规则= Microsoft.Interoperability#CA1404,Target = MyMethod:签名无效。"
"MSBUILD : error : CA0001 : Rule=Microsoft.Interoperability#CA1404, Target= MyMethod: Signature is not valid."
提前致谢。
推荐答案
您好Sabaridass,
Hi Sabaridass,
您是单独使用FxCop工具还是VS IDE?
Do you use the FxCop tool or the VS IDE separately?
>>" MSBUILD:错误:CA0001:读取模块"MyProject"时遇到以下错误:无法解析类型引用:[System.Core,Version = 4.0。 0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089] System.Func`2。
>>"MSBUILD : error : CA0001 : The following error was encountered while reading module 'MyProject': Could not resolve type reference: [System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]System.Func`2."
您的项目似乎是指您身边的不同装配,例如:
It seems that your project refer to different assembly in your side, like this case:
https://social.msdn .microsoft.com /论坛/ zh-CN / 2da95d68-f9ae-4c61-adb5-db036c24ef68 / fxcopcould-not-resolve-member-reference-xxxxxxxxxxxxstatusgetstatusflag?forum = vstscode
我认为你最好检查一下输出汇编文件。如果您使用VS代码分析工具,还请检查具有此特定属性的项目文件:
I think you'd better to check the output assembly file. Please also check your project file with this specific property if you use the VS code analyze tool:
https://stackoverflow.com/questions/21876887/assembly-reference-cannot-be-resolved-dependentassembly-issue
最诚挚的问候,
杰克
这篇关于我该如何解决“MSBuild错误; CA0001“在运行代码分析时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
|