我需要运行FxCop属性,这是我在NAnt构建文件中实现的。我有NAnt和NAntContrib。我已经将nantcontrib\bin的内容复制到nant\bin文件夹,并将环境变量设置为FxCopCmd.exe。
然后在运行NAnt脚本时得到错误:
无效属性(fxcop)
有什么问题吗?
发布于 2010-03-26 00:39:50
通过使用NAnt的FxCop任务,直接从NAnt调用NAntContrib任务而不使用NAntContrib任务要简单一些。有关实现细节,请查看一个关于集成我写的文章和NAnt的FxCop。
下面是代码:
<!-- specify location of required tools -->
<property name="dir.tools" value="tools" />
<!-- analyze build for code quality -->
<target name="analyze.fxcop" depends="build" description="Analyze generated code using FxCop">
<!-- specify location of input and output files -->
<property name="fxcop.input" value="wadmt.fxcop" />
<property name="fxcop.output" value="${dir.build}fxcop-results.xml" />
<!-- send the analysis work to the FxCop command-line tool -->
<exec program="${dir.tools}fxcopFxCopCmd.exe" failonerror="false">
<arg value="/project:${fxcop.input}" /> <!-- use the fxcop project file -->
<arg value="/forceoutput" /> <!-- create output even if no violations are found -->
<arg value="/summary" /> <!-- show some summary info -->
<arg value="/out:${fxcop.output}" /> <!-- specify an output file -->
</exec>
</target>https://stackoverflow.com/questions/2516166
复制相似问题