Export (0) Print
Expand All

ObjectCache.Host Property

Gets or set a reference to a managed hosting environment that is available to ObjectCache implementations and that can provide host-specific services to ObjectCache implementations.

Namespace:  System.Runtime.Caching
Assembly:  System.Runtime.Caching (in System.Runtime.Caching.dll)

public static IServiceProvider Host { get; set; }

Property Value

Type: System.IServiceProvider
A reference to a cache-aware managed hosting environment.

ExceptionCondition
ArgumentNullException

The value being assigned to the property is null.

InvalidOperationException

An attempt was made to set the property value more than one time.

The Host property is intended for use by .NET Framework host environments and by cache implementations that implement behavior that depends on the .NET Framework host environment.

The following table lists the set of host environment services that might be available from a managed hosting environment and that are available to ObjectCache implementations through the Host property:

Service

Description

IApplicationIdentifier

Lets host environments provide application domain identifiers that might be needed by a cache implementation for features such as identifying performance counters.

IFileChangeNotificationSystem

Lets host environments provide a custom file-change notification system, instead of using the one provided in the .NET Framework.

IMemoryCacheManager

Lets cache implementations report cache memory consumption to the host environment. This enables host environments to centrally manage memory consumption across multiple cache implementations.

NoteNote

Callers of this property value require unrestricted code access security permissions.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

  • Demand 

    for full trust for all accessors of this property. This property cannot be used by partially trusted code.

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.

Show:
© 2014 Microsoft