also the AspCoreModule exports entry points callable by UseIIS() via this handy code which get a handle to the aspnetcore module native code (which is available if aspnetcore model is hosting):
[DllImport("kernel32.dll")]
private static extern IntPtr GetModuleHandle(string lpModuleName);
public static bool IsAspNetCoreModuleLoaded()
{
return GetModuleHandle(AspNetCoreModuleDll) != IntPtr.Zero;
}
you should read the docs. UseIIS checks if hosted in process by aspnetcore module, and loads via DI an IServer that makes calls to aspnetcore module to stream request and response. If an IServer is not defines, the builder will inject an IServer based on Kestrel.
the IServer is just responsible for the mapping the input and response streams to the actual host. The AspNetCore core pipeline is independent of the IServer. so its:
<external source> --request--> <IServer> --request-> <AspNet Pipeline> --response-> <IServer> --response--> <external source>
where external source is some stream supported by the IServer. could be network, file, service bus, etc, whatever the IServer was designed to interface to.