Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 2.38 KB

unable-to-emit-assembly-error-message.md

File metadata and controls

60 lines (40 loc) · 2.38 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: BC30145: Unable to emit assembly: <error message>
Unable to emit assembly: <error message>
08/14/2018
vbc30145
bc30145
BC30145
2e7eb2b9-eda6-4bdb-95cc-72c7f0be7528

BC30145: 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

  1. Examine the quoted error message and consult the topic Al.exe for further explanation and advice.

  2. Try signing the assembly manually, using either the Al.exe or the Sn.exe (Strong Name Tool).

  3. If the error persists, gather information about the circumstances and notify Microsoft Product Support Services.

To sign the assembly manually

  1. Use the Sn.exe (Strong Name Tool)) to create a public/private key pair file.

    This file has an .snk extension.

  2. Delete the COM reference that is generating the error from your project.

  3. Open Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell.

  4. Change the directory to the directory where you want to place your assembly wrapper.

  5. 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"

    [!TIP] Use double quotation marks if a path or file contains spaces.

  6. In Visual Studio, add a .NET Assembly reference to the file you just created.

See also