Compiling netstandard20 libraries

Wonderful World 21 Reputation points
2022-04-21T11:38:14.537+00:00

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
.NET
Microsoft Technologies based on the .NET software framework.
3,364 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Wonderful World 21 Reputation points
    2022-04-23T13:07:53.48+00:00

    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?

    195737-image001.png

    0 comments No comments

  2. Wonderful World 21 Reputation points
    2022-04-23T17:14:47.173+00:00

    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.

    1. Can a
      netstandard2.0
      assembly be compiled with .net core 3.1 SDK by using the command
      dotnet build
      ?
    2. Are we using an outdated nuget tools which can't understand the
      netstandard2.0
      framework?

    We have a plan to migrate the apps to .NET 6 by the end of this year.

    0 comments No comments