Renaming ICSharpCode.SharpZipLib.dll

喜夏-厌秋 提交于 2019-12-06 16:39:21

You could try to disassemble the library and then re-assemble with a new name.

E.g.

1) Open Visual Studio command prompt.

ildasm /all /out=ICSharpCode.SharpZipLib.il ICSharpCode.SharpZipLib.dll
ilasm /dll /out=shortname.dll ICSharpCode.SharpZipLib.il

2) Add shortname.dll to the project

SInce you renamed the DLL, the .Net runtime doesn't know how to find it automatically.

You can call Assembly.Load to manually load the renamed file.
Note that you'll need to do that before calling any methods that use the assembly, since the JITter needs to load all types used (directly) by a method before the method starts executing.

The DLL is compiled so renaming the file will not change the namespace's inside of it anyway. You can assign an alias to it through a using directive.

using zip = ICSharpCode.SharpZipLib;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!