title: Visual Studio 2012 fails building Windows Phone (8.1) application - issue with TargetVersion
body: <p>I have setup MSVS2012 to build a tool for Windows phone 8.1 (BLUE). I use the same environment to build the tool for successive WDKs and was working well on my build machine till I hit the following issue with WDK 9651.12245.</p>
  
  <p>1>------ Build started: Project: wifiTool, Configuration: Release ARM ------</p>
  
  <p>1>c:\wdk\9651.12245_blue\Windows Kits\8.1\build\WindowsDriver.common.targets(77,5): error : Unknown or unsupported property value () for TargetVersion</p>
  
  <p>========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</p>
  
  <p>Clicking on the error line opens the file WindowsDriver.common.targets  which points to the following line in the XML file:</p>
  
  <pre><code> &lt;Error Text="Unknown or unsupported property value ($(TargetVersion)) for TargetVersion" Condition="'$(UnknownTargetVersion)' == 'true'" /&gt;
  </code></pre>
  
  <p>Sounds like the build system thinks that environment variables $(TargetVersion) is not set and/or it somehow signals ‘$(UnknownTargetVersion)' == 'true' which suggests it could not validate the target version.</p>
  
  <p>The file WindowsDriver.common.targets is located in the WDK installation: C:\wdk\9651.12245_BLUE\Windows Kits\8.1\build\WindowsDriver.common.targets which contains the XML schema and it seems to have an issue with the target version invoked by the build.</p>
  
  <p>I have following settings in the VS2012 project, all of which worked fine till this WDK:</p>
  
  <pre><code>       Configuration Properties  -&gt; General -&gt; Platform Toolset -&gt; “WindowsApplicationForDrivers8.1”
         Configuration Properties  -&gt; Windows Phone -&gt; Target Windows Phone Version -&gt; 8.1 (greyed out selection, seems linked with (1) above)
         Configuration Properties  -&gt; Windows Phone -&gt; Build for Windows Phone =&gt; Yes
  </code></pre>
  
  <p>Can anyone see what's wrong ? How come the build /tool fails to pickup the configured TargetVersion ? Is there a file/location I could open and look-up/modify so that it gets the correct TargetVersion in the pre-build validation step ?</p>
  
  <p>Regards,</p>
  
  <p>-cdhruv</p>