Ok now i will try to explain my problem as much as possible. I want to use popular compression algorithm 7zip at my c# project
There is already NuGet package for 7zip
Now when i install 7zip page https://www.nuget.org/packages/SevenZipSharp/0.64.0 it installs fine however it gives error when i try to run
An unhandled exception of type 'SevenZip.SevenZipLibraryException' occurred in SevenZipSharp.dll
Additional information: Can not load 7-zip library or internal COM error! Message: failed to load library
So i decide to add dll file manually and i get this error below
---------------------------
Microsoft Visual Studio
---------------------------
A reference to 'D:\51_doktora tez projesi\program_crawler\doktora_tez_projesi_crawler_program\ExternalDLLs\7z_9_38_2015_01_03.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
---------------------------
OK
---------------------------
Ok but i found a solution and it works that way
First install nuget package
And before start calling functions set path
SevenZip.SevenZipExtractor.SetLibraryPath("SevenZipSharp.dll");
SevenZip.SevenZipCompressor.SetLibraryPath("SevenZipSharp.dll");
Ok second question which is also interesting
I wanted to use latest version of 7zip DLL file. So downloaded it from official website : https://sourceforge.net/projects/sevenzip/files/7-Zip/9.38/
Downloaded MSI installed and got 64bit dll file. However when i try to reference this file, it fails with error message above: Please make sure that the file is accessible, and that it is a valid assembly or COM component.
However the trick works again
I install NuGet 7zip package. Then before calling functions i set these 2 lines of code and it uses latest version of DLL file
SevenZip.SevenZipExtractor.SetLibraryPath("ExternalDLLs/7z_9_38_2015_01_03.dll");
SevenZip.SevenZipCompressor.SetLibraryPath("ExternalDLLs/7z_9_38_2015_01_03.dll");
So i am looking for answers why all these happens? Why i can not directly add as a reference the DLL file however the trick works?
windows 8.1 64bit, Visual Studio 2013 update 3 WPF application