Ole*_*nge 13 fxcop .net-4.0 build-server
在带有.NET 4 SDK但没有Visual Studio 2010的Windows Server 2003 R2上,我尝试使用构建Visual Studio 2010解决方案
msbuild MySolution.sln /p:RunCodeAnalysis=true
Run Code Online (Sandbox Code Playgroud)
但那失败了.
在这样的环境中运行代码分析需要什么?
我收到此错误消息:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(129,9): error MSB6003: The specified task executable "FxCopCmd.exe" could not be run. Could not load file or assembly 'Microsoft.VisualStudio.CodeAnalysis.Sdk, Version=10.0.0.0, Culture=neutral, PublicKeyToken= b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
我已经从SDK中安装了FxCop,但幸运的是将变量FxCopDir指向FxCopCmd.exe的安装位置,并将此注册表项设置为该位置:
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Setup\EDev@FxCopDir
Run Code Online (Sandbox Code Playgroud)
Gid*_*sey 17
我在MSBuild服务器上遇到了同样的问题并修复了:
然后我从开发PC复制到构建服务器上的FxCop文件夹,如下所示:
在安装了Visual Studio的开发PC上搜索它们以找到它们.
然后使用.NET 4.0版本的gacutil.exe将Microsoft.VisualStudio.CodeAnalysis.Sdk.dll安装到GAC.
然后,您应该能够将代码分析作为MSBuild构建的一部分运行,并使其正常工作.
| 归档时间: |
|
| 查看次数: |
10908 次 |
| 最近记录: |