title: How do I specify $(TargetPath) in <StartArguments> a (cs|vb|fs)proj.user?
body: <p>I have a Visual Studio Project whose startup action is set to load the DLL in PowerShell like so:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup Condition="'$(Platform)' == 'Debug|x86'"&gt;
      &lt;StartAction&gt;Program&lt;/StartAction&gt;
      &lt;StartProgram&gt;C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe&lt;/StartProgram&gt;
      &lt;StartArguments&gt;-NoProfile -NoExit -Command Add-Type -Path  "Foo.dll" -PassThru | Select FullName&lt;/StartArguments&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"&gt;
      &lt;StartAction&gt;Program&lt;/StartAction&gt;
      &lt;StartProgram&gt;c:\windows\system32\windowspowershell\v1.0\powershell.exe&lt;/StartProgram&gt;
      &lt;StartArguments&gt;-NoProfile -NoExit -Command Add-Type -Path  "Foo.dll" -PassThru | Select FullName&lt;/StartArguments&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"&gt;
      &lt;StartProgram&gt;C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe&lt;/StartProgram&gt;
      &lt;StartArguments&gt;-NoProfile -NoExit -Command Add-Type -Path  "Foo.dll" -PassThru | Select FullName&lt;/StartArguments&gt;
      &lt;StartAction&gt;Program&lt;/StartAction&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"&gt;
      &lt;StartProgram&gt;c:\windows\system32\windowspowershell\v1.0\powershell.exe&lt;/StartProgram&gt;
      &lt;StartArguments&gt;-NoProfile -NoExit -Command Add-Type -Path  "Foo.dll" -PassThru | Select FullName&lt;/StartArguments&gt;
      &lt;StartAction&gt;Program&lt;/StartAction&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>I hand edited the file down to the following to remove redundancy:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup '$(Platform)' == 'x86'"&gt;
      &lt;StartProgram&gt;C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe&lt;/StartProgram&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition="'$(Platform)' == 'AnyCPU' or Condition="'$(Platform)' == 'x64'"&gt;
      &lt;StartProgram&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&lt;/StartProgram&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;StartAction&gt;Program&lt;/StartAction&gt;
      &lt;StartArguments&gt;-NoProfile -NoExit -Command Add-Type -Path  "Foo.dll" -PassThru | Select FullName&lt;/StartArguments&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>Now I would like to replace the hard coded "Foo.dll" with something like "$(TargetPath)". However, that evaluates to an empty string. The following also resolve to an empty string:</p>
  
  <ul>
  <li>$(AssemblyName)</li>
  <li>$(TargetName)$(TargetExt)</li>
  <li>$(TargetFileName)</li>
  </ul>
  
  <p>Setting the value <code>&lt;StartArguments&gt;-NoProfile -NoExit -Command Add-Type -Path  "$(Platform)" -PassThru | Select FullName&lt;/StartArguments&gt;</code> does create the commandline <code>"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoExit -Command Add-Type -Path  "x64" -PassThru | Select FullName</code></p>