Debugging in MSBuild
There's a nice switch in MSBuild:
/verbosity:level
The available verbosity levels are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. /v is also acceptable.
For example:
msbuild /v:diag
This way there's a lot of extra info that is generated for you and hopefully should help your debugging.
However there's another way - you can create a task that will just output the stuff you wan't to debug. I used it when I had to check why our custom code analysis wasn't working as we expect it to work:
First of all you need to make sure that you build is depends on something (this case BuildDependsOn) :
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)"/>
Now we can add custom actions:
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn); EyalDebugMessage</BuildDependsOn>
</PropertyGroup>
And here's the actual custom action (will print out all the rules):
<Target Name="EyalDebugMessage">
<Message Condition="$(RunCodeAnalysis)'=='true'" Text="Rules: $(CodeAnalysisRules)"/>
</Target>
Now you can search the output for "EyalDebugMessage and see all the rules