IStopListeningRegisteredObject::StopListening Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

[Supported in the .NET Framework 4.5.1 and later versions]

Stops listening for new requests.

Namespace:   System.Web.Hosting
Assembly:  System.Web (in System.Web.dll)

void StopListening()

The StopListening method is supported only when running in IIS integrated mode. The ASP.NET runtime does not guarantee that the StopListening method will ever fire.

The StopListening method must not throw exceptions, otherwise the behavior is undefined and the process will likely be terminated. Further, to avoid creating deadlocks, the StopListening method should not block execution.


In many applications the StopListening method can run at the same time as the Unload method.  If AppDomain unload occurs, the StopListening method might be forcibly aborted before it finishes executing.

.NET Framework
Available since 4.5.1
Return to top