Debugging properties in msbuild

One liner, we could just use
Message task.

Where to dump the variables/properties?
The Project
task defines an interesting entrypoint called InitialTargets, it is
run before actually building the project (defined in DefaultTargets
attribute). Modify the csproj file to something like:

1
2
3
4
5
6
7
<Project ToolsVersion="4.0" InitialTargets="Log" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- other properties go here.... -->
  <Target Name="Log">
    <Message Text="SearchPath = $(AssemblySearchPaths)"/>
  </Target>
</Project>

That will dump AssemblySearchPaths before your actual project is built.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s