Edit

Share via


Publish.RegisterAssembly(String) Method

Definition

Registers an assembly for COM interop.

public:
 virtual void RegisterAssembly(System::String ^ AssemblyPath);
public void RegisterAssembly (string AssemblyPath);
abstract member RegisterAssembly : string -> unit
override this.RegisterAssembly : string -> unit
Public Sub RegisterAssembly (AssemblyPath As String)

Parameters

AssemblyPath
String

The file system path for the assembly.

Implements

Exceptions

The input assembly does not have a strong name.

A caller in the call chain does not have permission to access unmanaged code.

-or-

A codebase that does not start with "file://" was specified without the required WebPermission.

AssemblyPath is null.

AssemblyPath is not found, or a filename extension is not specified.

AssemblyPath is not a valid assembly.

An assembly or module was loaded twice with two different evidences, or the assembly name exceeds the system-defined maximum length.

A method marked with ComUnregisterFunctionAttribute is not static.

-or-

There is more than one method marked with ComUnregisterFunctionAttribute at a given level of the hierarchy.

-or-

The signature of the method marked with ComUnregisterFunctionAttribute is not valid.

Remarks

RegisterAssembly uses the Assembly Registration tool (Regasm.exe) to register the creatable classes in the assembly. For more information, see Regasm.exe (Assembly Registration Tool).

Applies to