Hello, I've set up a Server Core 2016 machine with .Net core installed on it. I have reserved the urls http://*:80 and https://*:443, installed an ssl cert, and associated it with the https url.
When I use the code from Getting Started (https://docs.asp.net/en/latest/getting-started.html), I am able to get the expected Hello message from ASP.Net core using Kestrel. However, when I change to WebListener, I receive an HTTP Error 503, service unavailable error from the server. Here is my code (I only changed Program.cs and project.json, startup.cs is the same as the getting-started tutorial):
Program.cs:
using System;
using Microsoft.AspNetCore.Hosting;
namespace aspnetcoreapp
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseWebListener()
.UseUrls("http://*:80", "https://*:443")
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
Project.json:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"Microsoft.AspNetCore.Server.WebListener": "1.0.0"
},
"imports": "dnxcore50"
}
}
}
Any ideas why WebListener will not respond and Kestrel will?