ICSharpCode.SharpZipLib - and the really bad design decision to require building into Studio installation folder

... I knew that I would at some stage hammer my head against the wall because of this requirement. Not only does it make the build process complicated. It introduces Windows 3.11-style dependencies:

I am writing an app that does some project automation and uses ICSharpCode.SharpZipLib to unzip zip archives. Since I downloaded the latest version 0.86 and since I have to build into the SDL Trados installation folder, the dll will get copied by the build script as well.

So far so good. 

However, I had to learn that Studio uses the same DLL to unzip stuff - but a different version: 0.84.

This would not be an issue, if Studio was built to use any version of ICSharpCode.SharpZipLib. But it doesn't. 

RESULT: No file conversion is possible anymore until version 0.84 of ICSharpCode.SharpZipLib is copied back into Studio's installation folder.

So, be warned if you want to use your own DLL. You better rename it before building ;-)

Parents
  • Anonymous
    0 Offline Anonymous

    Hi Tom,

    If you have to use a different version of ICSharpZipLib in your app to what Studio uses, the rules of assembly resolution in .NET allow you to manage such conflicts in various ways (see this MSDN article and associated pages: http://msdn.microsoft.com/en-us/library/yx7xezcf).

    Of the possible ways you could use to handle your assembly resolution problem, I'd first try placing your updated version of ICSharpZipLib in a new subdirectory in the Studio installation folder, then adding a "dependentAssembly" node to your App.Config file and use a "codeBase" node inside that node to point the .NET loader to your alternative DLL location. This should work and means that you wouldn't need to rename any files.

    If that failed to work, or if you fancy a solution that is entirely in-code, the slightly more complex way would be to handle the AssemblyResolve event for your application's AppDomain using your own custom logic to accomplish the same thing as I described above.

    Does that help?

  • Hello Robert,

    thanks a lot for getting back to me!

    In the end of the day I want to keep the install process as simple as possible and I found that using Studio's own Ziplib version instead of deploying my own is much easier than anything else from renaming to changing build configurations.

    Kind regards,

    Tom

Reply Children