Trying to unzip a file on Win10 mobile (UWP) with the following code
using (ZipArchive archive = new ZipArchive(stream, ZipArchiveMode.Read))
{
ZipArchiveEntry entry = archive.Entries.First();
using (Stream reader = entry.Open())
{
throws at entry.Open() the following error.
"The underlying compression routine could not be loaded correctly."
with the inner exception
"Unable to load DLL 'clrcompression.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
Important to note:
- The entry.Open() works fine on win10 Desktop but not on Win10 mobile with the same project (UWP)
- Using Win10 mobile version 10.0.14393.576. (Lumia 650)
- UWP target version of the project is 10.0 BUILD 14393
- Using the same file for the Desktop and mobile version.
- The file is created at the backend with a simple
using (ZipArchive archive = new ZipArchive(stream, ZipArchiveMode.Create,true))
- I am using Xamarin forms (I don't think this is relevant)
Questions:
Has somebody experienced the same exception? What is the root cause of it?
What are available workarounds? (I need the file compressed cross platform)
UPDATE: I created simple test project as requested (thanks for looking into it).
The unzip works in the test project, but it is loading a different module.
The Debug/Modules window states that the exception throwing project uses System.IO.Compression.dll 4.06.24705.1, the working project uses 1.00.24301.1.
I uploaded both project.lock.json files for comparison https://1drv.ms/f/s!AqROiejT4oI3lL1q1tu3iJcfA2tKyg.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…