Multi file assembly with link to 7z.dll

Aug 30, 2009 at 10:47 PM


SevenZipSharp depends on 7z.dll but is not copied to output directory bin\debug. It has to be done manually.

C# does not see the link between the 2 dlls.

I found a way to create this link. The solution is to use multi file assembly.

In effect, an assembly is a group of files and not necessarily a single file. Those files are linked through a manifest file that is the entry point of the assembly.

When an assembly is referenced all the files part of the assembly are copied accross. So the solution is to make 7z.dll part of the assembly, so that C# can see the link and manage it.

Here is how I did it:

I decompiled the sevenzipsharp.dll.

ildasm /all SevenZipSharp.dll /out=dossier\

then I edited the manifest part of the IL file to add this line:

.file nometadata '7z.dll'

just before this one: .module SevenZipSharp.dll

Then I recompiled it:

ilasm /dll /resource=sevenzipsharp.res

Now it is a multi file assembly and C# copy 7z.dll accross automatically.


You don't need to do all that from the source code. It can be done directly.

It would be good if you could make this assembly a multi file assembly, so that it is easier to use.




Sep 1, 2009 at 11:00 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.