In DNN 9.2.0 Sharpziplib is updated to 0.86.0.518.
This is the most common library used for zip and unzip files in dotnet for years.
This generate a breaking change for all modules witch use Sharpziplib because the assembly name of Sharpziplib change.
In reality most of the apis of Sharpziplib are backward compatible. But because the assembly name change, the module developer need to recreate a module package that reference the new assembly. And because the new SharpZipLib assembly is not present in older DNN versions, the new generated module package is not compatible with older DNN versions.
How module developers can resolve this issue :
1) create a new distribution package specific for dnn version greater then 9.2
pro : clean project references
cons : maintain 2 VS projects and 2 dnn distribution packages
2) switch to dotnet 4.5 compression api and force people to use dotnet 4.5 for all dnn version
pro : remove dependecy to SharpZipLib (3th party lib)
cons : new versions of your module, can't run on older dotnet versions and need some code rewrite
3) create wrapper dnn library around sharpzip that runs on all dnn versions (using reflection)
pro : no impact for end users of your module
cons : no dependency management, no compile time errors
In the 2 opensource modules i manage OpenContent and OpenForm i chose option 3 to impact less as possible the users of the modules, first of all myself :)
So i will here share the wrapper class i create to solve this issue. It's contains basic apis for zip and unzip.
Once using this wrapper class, you can remove all dependencies to sharpziplib in your project.
It will automatically pickup the right assembly.
https://gist.github.com/sachatrauwaen/6900943e507ec1a3c556121d79bbd04f
Hope this help other dnn module developers.