Reputation: 772
I'm using Visual Studio 2013. I am writing some MSBuild by hand. Inside I have something like this:
<PropertyGroup>
<MyProperty>(complicated function)</MyProperty>
<PropertyGroup>
I load my project. I'd like some command, perhaps that I can execute in the immediate window, to print the value of "MyProperty".
What is the normal way of achieving this?
Edit: I discovered that I can make a <Target>
that prints the value of all my properties with the <Message>
task, but I can't find an easy way to execute this target from within the environment. I can set it as the DefaultTarget on the <Project>
, but then I have to unload the project and edit the file again to get back to a state where I can actually compile.
Supposedly I could do this using msbuild.exe /t from the command line, but it doesn't seem to work because the properties, and also the <Target>
itself, are defined in a file which is included via an <Import>
statement, and for some reason msbuild.exe /t doesn't seem to like that.
Upvotes: 1
Views: 2010
Reputation: 63298
MSBuild allows you to debug the script in Visual Studio,
You can also force verbose logging, by adding /v:diag to your MSBuild command line, where in the log all such variables can be easily analyzed.
There is really no need to do what you plan to do.
Upvotes: 2