【发布时间】:2011-12-15 14:19:19
【问题描述】:
我是 MSBuild 的新手,我需要一些时间来弄清楚如何做事。
所以我正在尝试将 FxCop 集成到我的项目中,以便在我在构建服务器上构建它们时自动运行。
目前的方法似乎是将自定义任务添加到您在构建时调用的构建中。所以到目前为止我已经创建了以下内容:
<Target Name="ExecuteFxCop">
<ItemGroup>
<Files Include="bin\XXXX.dll" />
</ItemGroup>
<!-- Call the task using a collection of files and all default rules -->
<MSBuild.ExtensionPack.CodeQuality.FxCop
TaskAction="Analyse"
Files="@(Files)"
SearchGac="True"
OutputFile="FxCopReport.xml">
</MSBuild.ExtensionPack.CodeQuality.FxCop>
</Target>
但是,当我运行此 >msbuild XXXX.csproj /t:ExecuteFxCop 时,它会失败并出现错误 512,我已将其范围缩小为来自间接引用程序集的异常:
<Exception Keyword="CA0060" Kind="Engine" TreatAsWarning="True">
<Type>Microsoft.FxCop.Sdk.FxCopException</Type>
<ExceptionMessage>The indirectly-referenced Silverlight assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. Silverlight reference assemblies should be specified with the '/reference' switch. This assembly was referenced by: XXX\bin\ESRI.ArcGIS.Client.dll.</ExceptionMessage>
</Exception>
但我无法添加此参考。有没有办法让构建看到这个引用,或者最好完全禁用错误?
我确实尝试过:http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/c6780439-bc04-459e-80c3-d1712b2f5456/ 但它不起作用
【问题讨论】: