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.
- dependentType
Type: System..::.Type
The Type of the dependent module.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.