msbuild: Microsoft.AppxPackage.Targets causes build failures

Customer reported the following issue:

Description: When attempting to run a build using MSBuild in a batch file, projects are failing due to the following exception:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(283,22): error MSB4086: A numeric comparison was attempted on "10.0.11000.0" that evaluates to "10.0.11000.0" instead of a number, in condition "'$(TargetPlatformVersion)' >= '10.0.11000.0'". [MyProject.csproj] 

This appears to be caused by the following segment within Microsoft.AppXPackage.Targets:

 <PropertyGroup> 
 <SdkIsRS1OrLater>False</SdkIsRS1OrLater> 
 <SdkIsRS1OrLater Condition="'$(TargetPlatformVersion)' &gt;= '10.0.11000.0'">True</SdkIsRS1OrLater> 
 </PropertyGroup> 

Switching the VisualStudioVersion flag in the batch file from 14.0 to 12.0 causes this batch file to build successfully. Additionally, it was running fine with 14.0 prior to the upgrade to Update 3.

Strangely, this appears to build fine when running directly inside Visual Studio.

Visual Studio Version: 14.0.25421.03

Repro Steps:Create a batch file with the following script. When running the build, the error will surface.

 @echo off 
 set CLRHome=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319 
 set MSTestDir=%vs140comnTools%..\IDE 
 Set VisualStudioVersion=14.0 
 set Path=%Path%;%CLRHome%;%MSTestDir% 

 MSBuild ./LocalBuild.proj /v:m /clp:Summary; /m:%multiCore% /nr:False /nologo 

Impact: Builds are unable to run with ToolsVersion 14.0. Any developer running exclusively 2015 updating to Update 3 will be unable to build the solutions from the batch files.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Closing this as there’s nothing more we can do from our side. The entry-point MSBuild must be a new enough MSBuild.