Article ID: 327131 - Last Review: May 18, 2007 - Revision: 3.8 BUG: RegisterAssembly cannot register a dynamic assemblyThis article was previously published under Q327131 On This PageSYMPTOMS When you register a dynamically generated assembly by using
the System.Runtime.InteropServices.RegistrationServices.RegisterAssembly
method, you may receive the following error message: An
unhandled exception of type 'System.NotSupportedException' occurred in
mscorlib.dll Additional information: The invoked member is not supported in a dynamic assembly. CAUSE The problem occurs because RegisterAssembly calls GetRegistrableTypesInAssembly, which in turn calls GetExportedTypes on the Assembly instance. However, this type is an AssemblyBuilder, which derives from Assembly and then overrides GetExportedTypes to throw a NotSupportedException. RESOLUTION To work around this problem, save the dynamic assembly to a
file and then register it from the disk. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
MORE INFORMATIONSteps to Reproduce the Behavior
REFERENCESFor additional information, visit the following Microsoft
Web sites: Exposing .NET Framework Components to COM http://msdn2.microsoft.com/en-us/library/zsfww439(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/zsfww439(vs.71).aspx) MSIL Disassembler (Ildasm.exe) http://msdn2.microsoft.com/en-us/library/f7dy01k1(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/f7dy01k1(vs.71).aspx) APPLIES TO
| Article Translations
|

Back to the top
