Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Manually Registering an Assembly 

The .NET Framework SDK provides the .NET Services Installation Tool (Regsvcs.exe) to manually register an assembly that contains serviced components. Regsvcs.exe is a command-line tool. You can also access these registration features programmatically with the System.EnterpriseServices.RegistrationHelper class by creating an instance of the RegistrationHelper class and using the InstallAssembly method.

Although not always required, it is helpful to manually register assemblies for design-time testing. Unlike dynamic registration, the manual process provides feedback about errors encountered during execution.

NoteNote

If you create a server application, the assembly and any assemblies on which it depends must be added to the global assembly cache (GAC) by using Windows Installer before the server application can be used; otherwise, the application generates an exception.

The following table lists each step performed by the Regsvcs.exe (or the API) and describes the failures that are possible at each step.

Step Possible failure Result

Loads the assembly.

The assembly fails to load.

Displays an error message and failure description.

Registers the assembly.

The type registration fails.

Improperly specified assemblies result in a TypeLoadException exception.

Generates a type library.

The library generation fails.

Improperly specified assemblies result in a TypeLoadException exception.

Calls the LoadTypeLibrary method to register the type library.

The Automation call fails.

Generates a TypeLoadException exception.

Installs the type library into the requested application.

The Assembly Registration tool (Regasm.exe) cannot find the specified application.

Displays the error message "One of the objects could not be found."

To resolve, confirm the location of the specified type library and application.

Configures the class.

The tool detects a service attribute mismatch during registration—for example, if you have a class configured with conflicting properties such as the following:

TransactionOption.Required

SynchonizationOption.Disabled

Displays an error that describes the conflict or modifies one of the mismatched services.

See Also

Community Additions

ADD
Show:
© 2015 Microsoft