Here is a sample msbuild script which i have written. Assuming New is the default target.
<Target Name="New" DependsOnTargets="Clean">
<MSBuild Projects=".\folder1\sample.csproj" />
</Target>
<Target Name="Clean" >
<ItemGroup>
<BinFiles Include=".\**\bin\**\*.*"/>
</ItemGroup>
<Delete Files="@(BinFiles)"/>
</Target>
On my project I have set warnings as errors and supressed quite a few warnings using System.Diagnostics.CodeAnalysis.SuppressMessage
.While this works well in visualstudio...I obtain all the errors coming up while i run the msbuild file.
I have checked the net and found that CODE_ANALYSIS
is supposed to be added to the conditional compilation symbols and I have done that (under project properties/build of all projects which sample.csproj is using) but I still face the same issue.
What can i be doing wrong?
Below is the log statement taken just before i get the errors.
RunCodeAnalysis:
Running Code Analysis...
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static AnalysisTools\FxCop\FxCopCmd.exe <lot of custom parameters references>