VS IDE can build, but run "dotnet build" command then got ".NETFramework,Version=v5.0 were not found"

297 Views Asked by At

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.

0

There are 0 best solutions below