none
Trouble with dll's RRS feed

  • Question

  • Greetings,

    I have a solution containing 4 projects. 3 of the projects are compiled into dll's which are used by the 4th project. The problem is that I don't want to distribute the dll's with the executable, I'd rather embed the dll's as resources, extract them at runtime, then use them, and clean them up when the app is done.

    I have the code in place that allows me to extract embedded resources and clean them up when I'm done, but I'm running into some runtime issues when the dll's aren't right next to the executable when I run it.

    The problem seems to be that my main project uses namespaces from the dll's, so the application seems to fail right away, compaining about a System.IO.FileNotFoundException. For example, one of the member variables in my main class is of type IConsoleManager, which is found in the IConsoleManager.dll, which doesn't exist yet. So when the main app runs, it errors out, saying the file doesn't exist yet, which is totally true.

    I'm looking for a way to prevent the runtime from erroring out when it can't find the assembly for the IConsoleManager. I want to wait until I extract the IConsoleManager.dll from my executable before I try to reference it.

    What's the best way to go about doing this?

    Tuesday, November 11, 2008 10:49 PM

All replies

  • Oh Lord, why do you make your life difficult like this?  I never get it, what's wrong with xcopy?  Google ILMerge.
    Hans Passant.
    Tuesday, November 11, 2008 11:19 PM
    Moderator
  • Thanks for the info, I will check out ILMerge.

    Nothing is wrong with xcopy, but it doesn't help me satisfy my requirements. =)
    Wednesday, November 12, 2008 2:55 PM