Click here to Skip to main content
15,905,616 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im using CADImport dll 14 version for dwg image viewer but when i add the dll im getting error in ICSharpCode.SharpZipLib for ZipInputStream method


Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0433	The type 'ZipInputStream' exists in both 'CADImport, Version=14.1.0.47042, Culture=neutral, PublicKeyToken=e66eb7f6b40a44a2' and 'ICSharpCode.SharpZipLib, Version=0.85.2.329, Culture=neutral, PublicKeyToken=1b03e6acf1164f73'	DMSWin	E:\DMS\Development\DMSWin\Utility\DMSZip.cs	19	Active


What I have tried:

I have added whole name space when calling the ZipInputStream method
FileStream fr = File.OpenRead(fileName);
  var ins = new ICSharpCode.SharpZipLib.Zip.ZipInputStream(fr);
Posted
Updated 15-Feb-21 2:02am
v2

1 solution

You can give one of the dll's an alias, this can be done in:
Solution Explorer - references
Set Aliases property from Global to "yourname"

Or add using statements with an alias like:
using MySharpZipLib = ICSharpCode.SharpZipLib.Zip;

And yet another way would be to put the dll in it's own subfolder and modify the .config file like explained here: ICSharpCode.SharpZipLib.DLL and SharpZipLib.DLL conflict in DNN7[^]
<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="ICSharpCode.SharpZipLib" />
        <codeBase version="0.81.0.1407" href="SharpZipLib/SharpZipLib.dll" />
      </dependentAssembly>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900