0

My visual studio pro 2019 is v16.11.2. I can build my mvc project without any issue by pressing build button, and run this project very well. Of cause, I've installed .net sdk 5.0.400 on my win10

enter image description here

Currently I'm studying docker, so I need to run command to build my project.

dotnet build "MVConDocker.csproj" -c Release -o /app/build

unfortunately it failed.

error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found.

enter image description here

In global.json file, it's 5.0.400.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
Miken
  • 9
  • 2
  • 2
    Somehow you managed to target .NET Framework 5.0, which doesn't exist. The latest version of framework is 4.8. I think you meant to target .NET 5.0 – Joery Sep 10 '21 at 15:02
  • Do you have a reference that is not compatible with .NET 5.0? – Schwarzie2478 Sep 10 '21 at 15:07
  • Please use text for text, not images. See [ask] for more tips on asking good questions for Stack Overflow. – Heretic Monkey Sep 10 '21 at 15:17
  • See https://learn.microsoft.com/en-us/dotnet/standard/frameworks#latest-versions for the correct values to put in the CSPROJ file (although VS2019 should be setting that for you). – Heretic Monkey Sep 10 '21 at 15:19
  • Can you edit the question to include the project file? – Lex Li Sep 10 '21 at 17:48

0 Answers0