Partajați prin


DeclareResourceDependency Method

Declares a dependency on a Microsoft Commerce Server site resource.

Namespace:  Microsoft.CommerceServer.Runtime
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Protected Shared Sub DeclareResourceDependency ( _
    resourceName As String, _
    dependentType As Type _
)
'Usage
Dim resourceName As String
Dim dependentType As Type

CommerceModule.DeclareResourceDependency(resourceName, _
    dependentType)
protected static void DeclareResourceDependency(
    string resourceName,
    Type dependentType
)
protected:
static void DeclareResourceDependency(
    String^ resourceName, 
    Type^ dependentType
)
protected static function DeclareResourceDependency(
    resourceName : String, 
    dependentType : Type
)

Parameters

  • resourceName
    Type: System..::.String
    The name of the Commerce Server resource that the current module depends on. Cannot be null.

Exceptions

Exception Condition
CommerceResourceDependencyException

The resource that the module is dependent upon does not exist.

ArgumentNullException

One of the required arguments was passed as a nullNothingnullptra null reference (Nothing in Visual Basic) value.

Remarks

Some of the Microsoft Commerce Server classes have dependencies. When the module is created, the module runs checks to ensure that all dependencies are satisfied. If these dependencies are not satisfied an exception is generated. For Example, when the derived CommerceCacheModule creates the caches it also runs checks to make sure that all resource dependencies are satisfied. If these dependences are not satisfied, a CommerceResourceDependencyException is generated.

Permissions

See Also

Reference

CommerceModule Class

CommerceModule Members

Microsoft.CommerceServer.Runtime Namespace