.net standard 2.0 and the final version 2.1 are supported by .net 3.1+
But nuget pack does not work with modern msbuild files, only the old 4.* format. You should use the dotnet pack or msbuild -t:pack commands instead.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
My IT department uninstalled .net core 2.0 SDK from our servers claiming that .net core 2.0 is no more supported by Microsoft.
Is there a version other than .net core 2.0 SDK which can be used to compile assemblies which have reference to netstandard20?
.net standard 2.0 and the final version 2.1 are supported by .net 3.1+
But nuget pack does not work with modern msbuild files, only the old 4.* format. You should use the dotnet pack or msbuild -t:pack commands instead.
There are two projects (1) .NET Core 3.1 (2) .netstanadard2.0 in the same solution. The error is happening in the .netstandard project when the build tries to build, pack and publish to nuget. It does not have a reference to
.net core 3.1
.
The
nuget pack
is the command run to build and pack the assemblies. When that command is run, nuget may be trying to build the project by looking at the targetframework in the
csproj
file. It can't find the version of msbuild or dotnet for
netstandard2.0
framework and may be erroring out.
We have a plan to migrate the apps to .NET 6 by the end of this year.
is the error from building a .netstandard 2.0 library project, or from an application build using the library. A .netstandard library should not have a reference to core sdk.
If it’s a library, then probably only worked with core projects. Just change from standard to a valid .net core frame, and update the nuget package to compatible versions.
Also, why 3.1? It’s support ends in December.
Our servers have already .NET Core 3.1 SDK . The project also has the setting that you shown above. But the command dotnet build fails!
We have nuget package manager which fails with the following error message. This build failure happened after .NET 2.0 SDK was uninstalled. So, we assume the corresponding dotnet SDK is unavailable.
Is it possible that the issue is with the nuget package manager?
no. it creates a project file with the framework set to netstandard 2.0
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>
so just:
dotnet build