The ToolsVersion attribute of the Project element of the project file.If the environment variable MSBUILDLEGACYDEFAULTTOOLSVERSION is set, or if ToolsVersion is not set, then the following steps are used:.If the environment variable MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT is set and the ToolsVersion defined in the project file is greater than the current ToolsVersion, use the current ToolsVersion.If the environment variable MSBUILDTREATALLTOOLSVERSIONSASCURRENT is set, then use the current ToolsVersion.The /toolsversion (or /tv) switch that's used in the msbuild.exe command, if any.The ToolsVersion attribute on the MSBuild task used to build the project, if any.The order of precedence, from highest to lowest, used to determine the ToolsVersion is: This lets you build a project in a solution with a ToolsetVersion that differs from that of the other projects: Override version by setting the $(Project.ToolsVersion) property on a project within a solution. Override version by setting the ToolsVersion parameter on the MSBuild task: Override version by using the /ToolsVersion switch (or /tv, for short) when you build the project or solution from the command line: msbuild.exe someproj.proj /tv:14.0 /p:Configuration=Debug You should read the MSDN article (or this answer), but TL DR your options are: In my experience I solved this problem in 3 different ways:Ģ- installing Microsoft Build Tools 2015 on the tfs serverģ- The sledgehammer and last options but for me the best because you don't need to deal with the dependency on nuget, is installing the visual studio version on the tfs server where you run the process.Īfter installing the MS Build tools 2015 into %ProgramFiles%\MSBuild\14.0\bin you need to override the MSBuild version for build server with new value ( 14.0). To C:\Program Files (x86)\MSBuild\14.0\Bin, there you should have thisįolder with the csc.exe compiler. To 14, but make sure you have installed the latest version of the ToolsVersion.that should be pointing to the version 12, then change it Version of C#, try to add the, from Nuget andĬompile again, that should resolve the issue. Is because, the compiler that is running your build is not the latest You don't need toĬhange your code to replace the string interpolation with Option on Target framework to point to the latest. Then go to your Project properties and change on the Application That feature is a syntactic sugar for C#6, try to install the latest Below is the link of my highlighted answer: Project builds fine with Visual Studio but fails from the command line The problem can be fixed installing a Nuget package
0 Comments
Leave a Reply. |