How to install the Microsoft.NET.Sdk on Windows Server 2019 Core?

1.3k Views Asked by At

I want to build my project in a docker desktop windows container. The OS is Windows Server 2019 Core (no interface, just a console).

If I want to build my solution with MSBuild like that:

msbuild MySolution.sln

I get this error message:

MyProject.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

Which means for me that I need to install Microsoft.NET.Sdk, for which I need to install the 'App Installer' (to get the 'winget' commands). And for that I need the Microsoft Store which is not supported in Windows Server 2019 Core.

Does anyone know how to solve this problem?

Edit:

  • projects in the solution are mixed of .NET Framework and .NET Core/.NET
  • msbuild is installed via 'Build Tools for Visual Studio' installation
  • How can I install the framework with command line?
1

There are 1 best solutions below

0
On

In the Microsoft documentation "Install .NET on Windows" there are sections for installations methods that don't use winget: