Partager via


RegisterAssembly Class

Definition

Registers a managed assembly for COM interop (equivalent of regasm.exe functionality, but this code doesn't actually call the exe).

This API supports the product infrastructure and is not intended to be used directly from your code.

public ref class RegisterAssembly : Microsoft::Build::Tasks::AppDomainIsolatedTaskExtension, System::Runtime::InteropServices::ITypeLibExporterNotifySink
public ref class RegisterAssembly sealed : Microsoft::Build::Tasks::TaskRequiresFramework
public class RegisterAssembly : Microsoft.Build.Tasks.AppDomainIsolatedTaskExtension, System.Runtime.InteropServices.ITypeLibExporterNotifySink
public sealed class RegisterAssembly : Microsoft.Build.Tasks.TaskRequiresFramework
type RegisterAssembly = class
    inherit AppDomainIsolatedTaskExtension
    interface ITypeLibExporterNotifySink
type RegisterAssembly = class
    inherit TaskRequiresFramework
Public Class RegisterAssembly
Inherits AppDomainIsolatedTaskExtension
Implements ITypeLibExporterNotifySink
Public NotInheritable Class RegisterAssembly
Inherits TaskRequiresFramework
Inheritance
Inheritance
Implements

Remarks

Framework64/<version>/RegisterAssemblyTask cannot resolve a library of COM objects registered as 32-bit components. Framework/<version>/RegisterAssemblyTask cannot resolve a library of COM objects registered as 64-bit components.

For example, if you register a library of COM objects called ClassLibrary1 as 32-bit components on a 64-bit machine, run Visual Studio, and change the target to x64, the build fails with the following error:

ClassLibrary1.dll is not a valid assembly

Constructors

RegisterAssembly()

This API supports the product infrastructure and is not intended to be used directly from your code.

Initializes a new instance of the RegisterAssembly class.

Properties

Assemblies

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the assemblies to be registered with COM.

AssemblyListFile

This API supports the product infrastructure and is not intended to be used directly from your code.

The cache file for Register/UnregisterAssembly. Necessary for UnregisterAssembly to do the proper clean up.

BuildEngine

The build engine automatically sets this property to allow tasks to call back into it.

(Inherited from AppDomainIsolatedTask)
BuildEngine

The build engine automatically sets this property to allow tasks to call back into it.

(Inherited from Task)
BuildEngine2

The build engine automatically sets this property to allow tasks to call back into it. This is a convenience property so that task authors inheriting from this class do not have to cast the value from IBuildEngine to IBuildEngine2.

(Inherited from Task)
BuildEngine3

Retrieves the IBuildEngine3 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine4

Retrieves the IBuildEngine4 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine5

Retrieves the IBuildEngine5 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine6

Retrieves the IBuildEngine6 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine7

Retrieves the IBuildEngine7 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine8

Retrieves the IBuildEngine8 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine9

Retrieves the IBuildEngine9 version of the build engine interface provided by the host.

(Inherited from Task)
CreateCodeBase

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Boolean value that specifies whether the task creates a codebase entry in the registry, which specifies the file path for an assembly that is not installed in the global assembly cache.

HelpKeywordPrefix

Gets or sets the prefix used to compose help keywords from string resource names. If a task does not have help keywords associated with its messages, it can ignore this property or set it to null. If the prefix is set to an empty string, then string resource names will be used verbatim as help keywords. For an example of how this prefix is used, see the LogErrorWithCodeFromResources(String, Object[]) method.

(Inherited from AppDomainIsolatedTask)
HelpKeywordPrefix

Gets or sets the prefix used to compose help keywords from string resource names. If a task does not have help keywords associated with its messages, it can ignore this property or set it to null. If the prefix is set to an empty string, then string resource names will be used verbatim as help keywords. For an example of how this prefix is used, see the TaskLoggingHelper.LogErrorWithCodeFromResources(string, object[]) method.

(Inherited from Task)
HostObject

The build engine sets this property if the host IDE has associated a host object with this particular task.

(Inherited from AppDomainIsolatedTask)
HostObject

The build engine sets this property if the host IDE has associated a host object with this particular task.

(Inherited from Task)
Log

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets an instance of a TaskLoggingHelperExtension class containing task logging methods.

(Inherited from AppDomainIsolatedTaskExtension)
Log

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets an instance of a TaskLoggingHelperExtension class containing task logging methods.

(Inherited from TaskExtension)
TaskResources

Gets or sets the task's culture-specific resources. Derived classes should register their resources either during construction, or via this property, if they have localized strings.

(Inherited from AppDomainIsolatedTask)
TaskResources

Gets or sets the task's culture-specific resources. Derived classes should register their resources either during construction, or via this property, if they have localized strings.

(Inherited from Task)
TypeLibFiles

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the type library to generate from the specified assembly.

Methods

Execute()

This API supports the product infrastructure and is not intended to be used directly from your code.

Task entry point

Execute()

Task entry point.

(Inherited from TaskRequiresFramework)
InitializeLifetimeService()
Obsolete.

Overridden to give tasks deriving from this class infinite lease time. Otherwise we end up with a limited lease (5 minutes I think) and task instances can expire if they take long time processing.

(Inherited from AppDomainIsolatedTask)
ReportEvent(ExporterEventKind, Int32, String)

This API supports the product infrastructure and is not intended to be used directly from your code.

Callback method for reporting type library export events

ResolveRef(Assembly)

This API supports the product infrastructure and is not intended to be used directly from your code.

Callback method for finding type libraries for given assemblies. If we are here, it means the type library we're looking for is not in the current directory and it's not registered. Currently we assume that all dependent type libs are already registered.

Applies to