使用Sonar时出现CA0053错误

时间:2016-01-18 21:30:23

标签: sonarqube fxcop sonarqube-5.0

运行VSSonarExtension时出现此错误:

MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\dataflowrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\designrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\globalizationrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\interoperabilityrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\maintainabilityrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\mobilityrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\namingrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\performancerules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\portabilityrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\reliabilityrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\securityrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\securitytransparencyrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\
  fxcop\rules\usagerules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : CA0053 : Unable to load rule assembly
  'c:\program files (x86)\microsoft visual studio 12.0\team tools\static analysis tools\
  fxcop\rules\securitytransparencyrules.dll': Unable to load one or more of the requested types.
  Retrieve the LoaderExceptions property for more information.
MSBUILD : error : Code Analysis detected errors.
  See Code Analysis results window or log file for details.
  1081 Warning(s) 15 Error(s)
  Time Elapsed 00:00:41.66 
  [CxxSonarQubeMsbuidRunner] Failed to build project, check log in .cxxresults\BuildLog.txt

People are saying由于项目是在之前的VS版本上创建的(我使用的是VS2013)。该错误与FxCop有关。有谁知道如何解决它并从VSSonarExtension获取报告?任何意见都表示赞赏!

1 个答案:

答案 0 :(得分:0)

看起来我想通了 - 错误确实是因为项目是在早期版本的VisualStudio上创建的。来自this website的修复有很大帮助 - 我已经检查了我的解决方案,将CA0053 Fix文件放在包含解决方案的文件夹中,确保文件(特别是所有的.csproj文件)都没有被读取 - 只是,并运行该工具。这似乎解决了这个问题。