Unable to emit assembly: <error message>
The Visual Basic compiler calls the Assembly Linker (Al.exe, also known as Alink) to generate an assembly with a manifest, and the linker reports an error in the emission stage of creating the assembly.
Error ID: BC30145
To correct this error
Examine the quoted error message and consult the topic Al.exe for further explanation and advice.
If the error persists, gather information about the circumstances and notify Microsoft Product Support Services.
To sign the assembly manually
Use the Sn.exe (Strong Name Tool)) to create a public/private key pair file.
This file has an .snk extension.
Delete the COM reference that is generating the error from your project.
In Windows 10, enter Developer command prompt into the search box on the task bar. Then, select Developer Command Prompt for VS 2017 from the results list.
Change the directory to the directory where you want to place your assembly wrapper.
Enter the following command:
tlbimp <path to COM reference file> /out:<output assembly name> /keyfile:<path to .snk file>
An example of the actual command you might enter is:
tlbimp c:\windows\system32\msi.dll /out:Interop.WindowsInstaller.dll /keyfile:"c:\documents and settings\mykey.snk"
Use double quotation marks if a path or file contains spaces.
In Visual Studio, add a .NET Assembly reference to the file you just created.
Send feedback about: