1

I have a solution where projects reference netcoreapp2.1, netstandard 2.0, net472, as targetframeworks.

Some have

    <TargetFrameworks>netstandard2.0;net472</TargetFrameworks>

others have

    <TargetFrameworks>netstandard2.0</TargetFrameworks>

others have

    <TargetFrameworks>netcoreapp2.1</TargetFrameworks>

After I deleted the Nugetfallback folder because of unrelated problems, suddenly my build fails with hundreds of errors about netstandard library classes no longer being found, e.g.

C:\Windows\system32\config\systemprofile\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.WebSockets.dll' could not be found.

what my build does basically boils down to:

nuget.exe locals all -clear
nuget.exe restore {MY_SOLUTION}
msbuild /restore {MY_SOLUTION}

Looking into the nuget/packages folder, I can see that the netstandard library exists after nuget restore, but in the ...\netstandard.library\2.0.0\ folder, and not in the ...\netstandard.library\2.0.3\

I've tried

  • deleting the nuget cache manually
  • using an explicit packagereference to the netstandardlibrary 2.0.3 in my csproj files,

but this hasn't helped.

The Solution Explorer in Visual Studio shows me that in the solution there are only dependencies to netstandard 2.0.3, none to 2.0.0

all the relevant packages.config files show

<package id="NETStandard.Library" version="2.0.3" targetFramework="net462" />

Why is the wrong version of the netstandard.library retrieved by nuget (2.0.0 instead of 2.0.3). Where in my solution could I configure/change this? Could this be because of other libraries where I have the wrong version as dependency?

Thanks!

2
  • Did the NetStandard.library show the 2.0.3 on the solution explorer? And I tested what you described in my side and get the right behavior without any errors. Try these 1) close VS, delete .vs hidden folder under the solution folder, bin and obj folder, then restart your project 2) create a single new net standard 2.0 project and test whether it builds well 3) repair vs from vs_installer Commented Mar 24, 2021 at 7:10
  • yes, it did show 2.0.3. Commented May 10, 2021 at 10:48

1 Answer 1

1

Reinstalling nuget, and installing a newer version of the dotnet SDK helped. No idea what caused it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.