Host ServiceStack.Core Using http.sys

We have the need to host ServiceStack in ServiceFabric, this requires us to have some host that supports port sharing. It seems the way to go is [http.sys][1] in .NET Core.

How can we achieve this?

I´ve tried to look at the ServiceStack.Kestrel class AppSelfHostBase and create something similar with a different ConfigureHost method:

public virtual IWebHostBuilder ConfigureHost(IWebHostBuilder host, string[] urlBases)
{
  return host
      .UseHttpSys(options =>
      {
        options.MaxRequestBodySize = 30000000;
      })
      .UseContentRoot(System.IO.Directory.GetCurrentDirectory())
      .UseWebRoot(System.IO.Directory.GetCurrentDirectory())
      .UseStartup<Startup>()
      .UseUrls(urlBases);
}

But this doesnt seem to work, I get no errors or anything but I cant seem to reac the service either (I get 503 unavailable).
[1]: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/httpsys?view=aspnetcore-2.1

None of the above .NET Core bootstrap code is relevant to ServiceStack, can you get it working without ServiceStack i.e. as a normal .NET Core App? Then you should just be able to plug in ServiceStack as a .NET Core module, e.g:

//Register your ServiceStack AppHost as a .NET Core module
app.UseServiceStack(new AppHost { 
    AppSettings = new NetCoreAppSettings(Configuration)
}); 

But if you’re running this in ServiceFabric there’s not much benefit trying to run as a .NET Core App. We have an example showing a self-hosting HttpListener running in ServiceFabric over at: