C# embed dll in exe RRS feed

  • Question

  • I have an executable (.exe) developed in Visual Studio 2017, I compile it with Costura.Fody to package all the dll that are needed during the execution of the application, however there are 1 dll that must be manually copied to the same application location because but exceptions are generated at run time.

    The dll works perfectly when the app's setup is executed but it fails when the .exe is executed Why, if the dll is sent to be packaged with Costura.Fody, do you have to copy them manually? Is there any way to include the dll in the .exe other than Costura.Fody?

    Monday, November 13, 2017 2:46 PM

All replies

  • what exceptions and where?

    how did you copy?

    can't answer your question without knowing how your code is and where it goes wrong.

    Visual C++ MVP

    Monday, November 13, 2017 2:57 PM
  • The exceptions is: The file or assembly 'xxxx, Version = 1.0.6520.16876, Culture = neutral, PublicKeyToken = null' or one of its dependencies can not be loaded. Attempt to load an executable file that can not be checked (the IAT table has more than 2 sections or a TLS section). (Exception from HRESULT: 0x80131019)
    Tuesday, November 14, 2017 1:35 AM
  • Are you trying to load a mixed mode assembly using Assembly.Load?

    Visual C++ MVP

    Tuesday, November 14, 2017 9:18 PM