System.Net.HttpListenerException: The I/O operation has been aborted because of either a thread exit or an application request

In .NET Framework AppSelfHostBase.cs is just a wrapper over AppHostHttpListenerPoolBase.cs, it differs with AppHostHttpListenerBase where instead of executing the Request in the I/O callback thread it instead executes it in a new Thread.

One change you could try is have your self-host inherit from AppHostHttpListenerSmartPoolBase from the ServiceStack.NetFramework NuGet package which is a bit more resource efficient as it reuses threads from a more efficient ThreadPool (in case the issue is due to lack of resources to execute properly).

1 Like