Share via


SPUserCodeCachedAssemblyGroup.Add method (SPUserCodeAssemblyFileDefinition)

Stores the data of an assembly file from the user assembly group to disk and to the in-memory cache.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub Add ( _
    assemblyGroupFileDefinition As SPUserCodeAssemblyFileDefinition _
)
'Usage
Dim instance As SPUserCodeCachedAssemblyGroup
Dim assemblyGroupFileDefinition As SPUserCodeAssemblyFileDefinition

instance.Add(assemblyGroupFileDefinition)
public void Add(
    SPUserCodeAssemblyFileDefinition assemblyGroupFileDefinition
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

The assemblyGroupFileDefinition parameter is a null reference, or the name of specified file is null or empty.

ArgumentOutOfRangeException

The assembly file has no content.

-or-

The assembly file is too big.

-or-

A file with the same name as the assembly file already exists in the assembly file group.

-or-

Both the FileContents() and FileStream() properties for the assemblyGroupFileDefinition have values.

InvalidOperationException

Failed to create cached user assembly file.

-or-

The assembly file name is null or is a DLL that does not have a strong name.

Remarks

This method saves the file from the user assembly group to disk in the directory specified in the RootDirectoryPath property. This method will create all directories and subdirectories in the specified path if they do not exist.

This method does not support files that are greater than MaxValue bytes (approximately 2GB) in size. The assembly file specified by assemblyGroupFileDefinition must have a strong name if it is a DLL.

See also

Reference

SPUserCodeCachedAssemblyGroup class

SPUserCodeCachedAssemblyGroup members

Add overload

Microsoft.SharePoint.Administration namespace