引用同名的DLL [英] Referencing DLL's with same name

查看:200
本文介绍了引用同名的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序引用了Sage50 SDK,我需要支持该SDK的多个版本.

My application references the Sage50 SDK and I need to support multiple versions of the SDK.

在Visual Studio中,每个版本的SDK都有自己的项目,并引用了SDK DLL.

In Visual Studio each version of the SDK has its own project and has the SDK DLL's referenced.

但是,当我构建解决方案时,DLL会互相覆盖,并且仅保留1个版本.

But when I build the solution the DLL's overwrite eachother and only 1 version remains.

我无法重命名DLL,因为SDK会按名称加载其他DLL,并且在重命名时会出错.并且它们已经签名.

I can't rename the DLL's because the SDK loads other DLL's by name and will error out when they are renamed. And they are signed.

我将如何处理这种情况?

How would I go about a situation like this?

推荐答案

  1. 使每个项目对这些不同的sage SDK程序集使用强"引用.也就是说,确保它指定了版本,区域性和令牌等.没有比没有版本的草率引用更糟糕的了.
  2. 您将必须将项目DLL的输出输出到单独的位置.因为该构建会将所有依赖项复制到输出文件夹.
  3. 由于#2,您将必须在应用程序中动态加载程序集. (即Assembly.load(...))

这篇关于引用同名的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆