Search code examples
c#asp.net-core.net-corewindows-server-2016

Running Vanilla ASP.NET-Core website on windows server get message "Did you mean to run dotnet SDK commands"


I'm trying to run the default vanilla ASP.NET core website from VS, on my windows server 2016 instance. But when I run it I get a HTTP 502.3 error

enter image description here

I enabled logging from the web config, the logging message I get back is

Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

I've install the windows hosting bundles

https://dotnet.microsoft.com/download/dotnet-core/2.2

https://dotnet.microsoft.com/download/dotnet-core/2.1

enter image description here

The CSProj is targeting the netcoreapp2.1 runtime

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

Solution

  • The default publication was using 'portable' as a target runtime, which requires the SDK to be installed. Switching it to match your machine architecture, 'win-x64' in that case, enables it to run with simply the proper dotnet runtime installed.