Assign parameter value taken from a property in MSBuild
<p>I'm trying to combine batch script and C# code using MSBuild and inline tasks.Looks like the only one way to pass a command line argument is to use a properties (<code>/property</code> command line switch in msbuild) and the only one way to access something external from the inline task is to use properties.</p>

<p>How can I combine the properties and parameters in MSBuild in way to make them accessible in the inline task?</p>

<p>Here's an example script (should be saves as <code>.bat</code> or <code>.cmd</code>) :</p>

<pre><code>&lt;!-- :
    @echo off


        echo -^- FROM BATCH

        for /r "%SystemRoot%\Microsoft.NET\Framework\" %%# in ("*msbuild.exe") do  set "msb=%%#"

        if not defined  msb (
           echo no .net framework installed
           exit /b 10
        )

        rem ::::::::::  calling msbuid :::::::::
        call %msb% /nologo  /noconsolelogger "%~dpsfnx0"  /property:"H=From C#"
        rem ::::::::::::::::::::::::::::::::::::
        exit /b %errorlevel%
--&gt; 


&lt;Project ToolsVersion="$(MSBuildToolsVersion)" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  &lt;Target Name="_"&gt;
    &lt;_/&gt;
  &lt;/Target&gt;
  &lt;UsingTask
    TaskName="_"
    TaskFactory="CodeTaskFactory"
    AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll" &gt; 

    &lt;ParameterGroup  &gt;
         &lt;Z ParameterType="System.String"&gt;$(H)&lt;/Z&gt;
    &lt;/ParameterGroup&gt;

    &lt;Task&gt;
      &lt;Code Type="Fragment" Language="cs"&gt;
        &lt;![CDATA[
            System.Console.WriteLine("-- "+"$(H)");  
        ]]&gt;
      &lt;/Code&gt;
    &lt;/Task&gt;
  &lt;/UsingTask&gt;
&lt;/Project&gt;
</code></pre>

<p>as <code>/property:H=Hello</code> is passed to the , the intention is this script to print
<code>--Hello--</code> but it only prints <code>----</code></p>