2
votes

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.

1
You've already found the answer, what more do you need to know?Hans Passant
Given that, the only thing I needed to know is what you just told me. :) Thanks.Narf the Mouse

1 Answers

0
votes

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.