Inside Out

Debugging properties in msbuild

<p>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:

``` {.line_numbers} 12 3 4 5 6 7 ```

<Project ToolsVersion=“4.0” InitialTargets=“Log” DefaultTargets=“Build” xmlns=””>;

  <!— other properties go here… —>

  <Target Name=“Log”>

    <Message Text=“SearchPath = $(AssemblySearchPaths)“/>



That will dump *AssemblySearchPaths* before your actual project is built.

You're in a happy corner. Take a moment. Breathe. Reflect. Did you hear the sound of silence?

© 2021 Inside Out. This work is licensed under a  CC-BY-NC-SA 4.0 License.