Error starting MSBuild

I started getting the following error when trying to run MSBuild through a batch file on my machine.

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ AppxPackage \ Microsoft.AppXPackage.Targets (283.22): error MSB4086: a numerical comparison was made on "10.0.11000.0", which instead of "number "evaluates to" 10.0.11000.0 ", condition" '$ (TargetPlatformVersion)'> = '10 .0.11000.0 '". [MyProject.csproj]

This happens in several different projects as part of the solution.

I am currently running VS2015 (Update 3). I upgraded from Update 2 on Friday. Therefore, it is possible that this may be related.

Based on various posts on the Internet (like this ), it seems like it was (at some point, at least in the past) caused by Resharper. However, I updated Resharper to the latest version and started the installation repair, but to no avail. I even tried to pause it in Visual Studio itself.

I also tried to repair the VS215 installation. But I still get the error.

How to solve this error?

Update

So, when I run this batch file, it works with VisualStudioVersion=12.0 . This seems to be part of the problem. When I draw it in 12.0 , the assembly is fine.

Check in the goals file that throws an exception, you can see this on line 283:

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

So, I'm not quite sure why this is so, but there seems to be a problem in the target file from MS?

+6
source share
3 answers

Try setting the path and environment variables using the batch file supplied with VS2015, instead of manually setting the msbuild and "VisualStudioVersion" paths to add the following to the batch file:

 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" 

I am not sure what the reason is, I suspect that the versions of MSBuild and the target files do not match.

For more information about the batch file, see https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx .

+3
source

I got the same error when we did the build in Teamcity. I got it working after reconfiguring the teamcity build step to use MSBuild Tools 2015 for MSBuild version and 14.0 as the version of MSBuild tools. enter image description here

+1
source

Yes, I suspect the same thing - it seems that someone has replaced and put the &gt; instead of > . I found 3 entries &gt; in this file in places where it should logically be > PS: This is not an answer, comments do not support character screening

The cursive text above was too fast, I thought I caught a problem with a smoking gun, but rechecking the code inside this .targets file shows that &gt; It is used correctly in the condition: to encode these characters according to the MSBuild Terms , although it is still unclear why it is trying to compare strings with '> ='. Using it in the other 2 cases is of less importance. In any case, I suspect that you are right, and this is a problem with a specific target file.

0
source

All Articles