I have a csproj which targets .NET framework 4.6.1 and .NET Standard 2.0.
It can be compiled in my local machine with Visual Studio 2017 (v15.3.2)
Now I am setting up our building server(Jenkins) to include this project. Our building server works fine for other .NET framework 4.6.1 projects.
First, I copied the toolchain from my local machine (C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\
) to the building server.
Then I configured Jenkins to use the MSBuild v15.3.409.57025, which was copied from C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
But it results in the following error on compilation
C:\Program Files (x86)\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(126,5): error : The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0.
The file Microsoft.NET.TargetFrameworkInference.targets
was also copied from my local machine C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets
. I checked its content in my local machine and saw a line below.
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
The ToolsVersion
is still 14.0
in my VS2017 directory?
Does anyone know how to solve it?
Thanks