如何将vb.net dll添加到c#应用程序中

如何将vb.net dll添加到c#应用程序中,c#,vb.net,dll,ilmerge,C#,Vb.net,Dll,Ilmerge,我在C#windows中开发了一个应用程序,我需要添加vb.net dll文件。我尝试从源代码->添加引用添加dll文件。但是,我遇到了错误 **Could not find the dll files ** 因为我正在添加dll文件(assembly1到assembly**2和**assembly2到assembly3) **新代码** C:\ProgramFiles(x86)\Microsoft\ILMerge>ILMerge/t:dll/out:ExcelImportnew.d

我在C#windows中开发了一个应用程序,我需要添加vb.net dll文件。我尝试从源代码->添加引用添加dll文件。但是,我遇到了错误

   **Could not find the dll files **  
因为我正在添加dll文件(assembly1到assembly**2和**assembly2到assembly3

**新代码**

C:\ProgramFiles(x86)\Microsoft\ILMerge>ILMerge/t:dll/out:ExcelImportnew.dll ExcelImport.dll BOL.dll

合并期间发生异常:

      Access to the path 'C:\Program Files (x86)\Microsoft\ILMerge\ExcelImportnew.dll' is denied.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
          at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolea
         useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, Sring msgPath, Boolean bFromProxy)
               at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, In32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
            at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
             at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
           at ILMerging.ILMerge.Merge()
            at ILMerging.ILMerge.Main(String[] args)
请告诉我为什么会出现此错误。如何解决此错误。
谢谢

您是否尝试将dll与ILMerge合并

ilmerge /target:library /out:YourLib.dll ClassLibrary1.dll ClassLibrary2.dll

如果VB和C#项目都有源代码,请将它们都添加到Visual Studio解决方案中。现在可以将它们添加为项目引用


这可能是最简单的入门方法。

添加对所有这些程序集(1、2和3)的引用。每个项目编译为一个单独的DLL,因此,您需要添加对其他两个dll的引用。您好,谢谢您的回复。这是否意味着要将asb1和asm2添加到asm3中。实际上,assembly3是我的主dll文件。您好,SSS我编译了每个项目,并将dll文件添加到我的主项目assembly3中,但它找不到文件路径。我已将属性副本设置为本地。请检查此链接