Is there a way to make fxcopcmd to always return 0?

177 views Asked by At

I would like to use fxcop in a continuous build, and almost every class in my project are analysed, but there is some exception (assembly load) and it makes the fxcopcmd exit with error code 8. So the continuous build fails, because of this error code.

I want the build to finish, so that i can present all the results, even those exceptions.

So is there a way to suppress the error code ?

Thanks

1

There are 1 answers

1
Peter On

You might want to search why it can't load the assembly. If you just want the build to continue, even if there are FxCop rule violations, you could set FailOnError to False. If you use MSBuild, that is. Our file has something that looks like this (never mind the variables):

<FxCop TargetAssemblies="@(BusinessAssembly)" ProjectFile="business.fxcop" AnalysisReportFileName="$(FxCopReportFile)" ToolPath="$(FxCopToolPath)" FailOnError="True" />

If you set the FailOnError to False, the build will just continue, but you'll have the business.fxcop report. But, if there are real FxCop violations, the build will continue also. Keep that in mind.