How do you 开发者_如何学Gointegrate FxCop with a NAnt script? In my solution I have many projects with lots of DLLs.
this is my sample code:
<target name="runFxCop">
<exec program="${build.dir}\tools\MicrosoftFxCop\FxCopCmd.exe" commandline="/p:${build.dir}\svn_platform.FxCop /o:${build.dir}\FxCop_Output\fxcop-results.xml" failonerror="false" />
</target>
I'm getting the error:
Analysis was not performed; at least one valid rules assembly and one valid target file must be specified.
1 total analysis engine exceptions.
If I may, I suggest you take a look at an article I wrote on the matter some time ago. Slightly old, but still applies.
Long story short, the FxCop task in NantContrib is finicky, and requires having FxCop installed. I like to have binary tools in source control, alongside my code. To make this work, I use NAnt's exec
task to delegate to the local (non-installed) copy of FxCop, which does the work.
Use the fxcop task
精彩评论