2

As a followup to this thread, is it possible to embed a .dll into a .dll as an embedded resource?

That is to say, if Wrapper.dll relies on Wrapped.dll, and Wrapper.dll is an embedded resource of Game.exe, is it possible to make Wrapped.dll an embedded resource in Wrapper.dll?

Or, if not possible, is there an acceptable substitute using embedded resources that doesn't require Game.exe to know about Wrapped.dll?

Looking specifically for methods using embedded resources; this is, in part, a learning exercise.

This thread:

Embedding one dll inside another as an embedded resource and then calling it from my code

Seems to indicate that the Wrapped.dll will automatically be loaded as an embedded resource .dll using the method discussed in this threads' precursor.

Thanks.

2
  • You've already found the answer, what more do you need to know? Jun 7, 2012 at 10:02
  • Given that, the only thing I needed to know is what you just told me. :) Thanks. Jun 7, 2012 at 10:12

1 Answer 1

0

I don't think it will work like you want it to. First of all, I think you'd have to try and extract the assembly as binary data and write it into your bin, so the fusion engine can actually find and load the assembly. All of this before anything tries to reference a type in the embedded DLL.

You could use ILMerge instead to merge multiple assemblies into one. No resources required, no fussing around with trying to load the assembly into the app domain.

3
  • Thing is, I'm not trying to learn ILMerge at this point. :) This is, in part, a practice exercise I set myself. Jun 7, 2012 at 9:46
  • There's not much to it, and it's much easier than what you're trying to do.
    – moribvndvs
    Jun 7, 2012 at 9:48
  • If I knew what all it was useful for, it wouldn't be called "practice". :) It's good to learn things, just to see what the bits do when you fiddle with them. Jun 7, 2012 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.