7z.dll for x64

Aug 26, 2010 at 10:24 AM


Can You add file 7z.dll for x64 (like 7zx64.dll) to the SevenZipSharp project and use him automatically on x64 environment?

Thank you.

Aug 26, 2010 at 1:07 PM
Edited Aug 26, 2010 at 1:10 PM

I built the x64 dll and included in the project

Aug 26, 2010 at 1:31 PM

7z x64 native dll? I not found it on SVN.

I thing, the best way is include x86 and x64 native (7z.dll and 7zx64.dll) and on init SevenZipSharp run:

if (Environment.Is64BitProcess) SevenZip.SevenZipCompressor.SetLibraryPath("7zx64.dll");
else SevenZip.SevenZipCompressor.SetLibraryPath("7z.dll"


SevenZip.SevenZipCompressor.SetLibraryPath(Environment.Is64BitProcess ? "x64" : "x86" + "\7z.dll");

Is it posible?


Aug 26, 2010 at 1:33 PM

Oh? Sorry. I found x64 dll now.

Aug 26, 2010 at 3:17 PM

As for the code you suggest, it should be better done manually in your own project rather than in SevenZipSharp code itself.

Aug 27, 2010 at 7:23 AM
markhor wrote:

As for the code you suggest, it should be better done manually in your own project rather than in SevenZipSharp code itself.

May be You are right. May be, You can try add native dll files to resources and import them directly. I thing, this solution can help you http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.dllimportattribute.aspx, but I not checked them.

Quotation from MSDN

If an unmanaged DLL file is included in an assembly, for example, by using the linker or the /linkresource compiler option, you can specify the assembly display name as part of dllName. For example, if an unmanaged DLL named unmanaged.dll is included in a managed assembly named MyAssembly, the attribute might be specified as shown in the following code.

[DllImport("unmanaged.dll, MyAssembly, Version=," "Culture=neutral, PublicKeyToken=a77e0ba5eab10125")]
static extern int SomeFuncion1(int parm);
Also, I found little bug. You not set attribute "Copy local" for 7z64.dll file. Please, correct this in next revision.

Tank you.

Nov 24, 2010 at 6:55 AM


It's realy actual. Please, set attribute "Copy local" for 7z64.dll file like for 7z.dll and commit it to SVN.

Tank you.

Dec 22, 2010 at 7:21 AM


59007 Added the automatic copy of 7z.dll of the architecture corresponding to the building machine (VS 2010)

It's great idea, but wrong :(

First: Configuration "Any CPU". Developer machine is x64, user machine is x86. On developer machine not problems, but on user machine..... crach....

Second: File 7z.dll is not copied to the solution output directory "Solution\bin\Debug", only in SevenZip project output directory "SevenZip\bin\Debug". As result, we have crach, becouse 7z.dll not found.

The best way for resolve this problems is set attribute "Copy local" for 7z.dll and 7z64.dll file and use next scenario:

SevenZip.SevenZipCompressor.SetLibraryPath("7z" + (Environment.Is64BitProcess ? "64" : "") + ".dll");
SevenZip.SevenZipExtractor.SetLibraryPath("7z" + (Environment.Is64BitProcess ? "64" : "") + ".dll"); // I dont no, is realy need this line

Tank you.

May 11, 2011 at 6:36 AM