Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IRegisteredObject Interface

Defines methods for objects that are managed by the hosting environment.

Namespace:  System.Web.Hosting
Assembly:  System.Web (in System.Web.dll)
public interface IRegisteredObject

The IRegisteredObject type exposes the following members.

  NameDescription
Public methodStopRequests a registered object to unregister.
Top

Objects must implement the IRegisteredObject interface in order to register with the hosting environment and have their lifetime managed by the hosting environment.

You can create an instance of a registered object by calling the ApplicationManager.CreateObject method on the application manager. The application manager returns the newly created object to the caller, which can then call a type-specific method on the object. During startup, the registered object should call the HostingEnvironment.RegisterObject method to complete registration of the object.

When the application manager needs to stop a registered object, it will call the Stop method.

Applications can have only one instance of a registered type. To create multiple instances of a registered type, use the factory pattern to create an object manager that is registered with the application and then manages the multiple instances. For an example of an object implementing the factory pattern, see the example for the ApplicationManager class.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.