title: How to print the value of an MSBuild <Property> inside the environment?
body: <p>I'm using Visual Studio 2013.  I am writing some MSBuild by hand.  Inside I have something like this:</p>
  
  <pre><code>&lt;PropertyGroup&gt;
    &lt;MyProperty&gt;(complicated function)&lt;/MyProperty&gt;
  &lt;PropertyGroup&gt;
  </code></pre>
  
  <p>I load my project.  I'd like some command, perhaps that I can execute in the immediate window, to print the value of "MyProperty".</p>
  
  <p>What is the normal way of achieving this?</p>
  
  <p>Edit: I discovered that I can make a <code>&lt;Target&gt;</code> that prints the value of all my properties with the <code>&lt;Message&gt;</code> 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 <code>&lt;Project&gt;</code>, but then I have to unload the project and edit the file again to get back to a state where I can actually compile.</p>
  
  <p>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 <code>&lt;Target&gt;</code> itself, are defined in a file which is included via an <code>&lt;Import&gt;</code> statement, and for some reason msbuild.exe /t doesn't seem to like that.</p>