在使用两个SDK的一个ASP现场使用两种不同的版本相同的DLL的 [英] Using two different versions of the same DLL in an ASP site using two SDK's

查看:154
本文介绍了在使用两个SDK的一个ASP现场使用两种不同的版本相同的DLL的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用的应用程序名为DynamicDashboards建立在工作中统计的仪表板。这是$ P $使用pcompiled其他两个依赖Ext.Net 1.5.0.0和4.0.8.0 Newtonsoft.Json。同时,我想使用的Ext.Net 2.1的新版本打造这需要Newtonsoft.Json 4.5.0.0一些模块。

I am trying to use an application called DynamicDashboards to create a stats dashboard at work. This is precompiled using two other dependencies Ext.Net 1.5.0.0 and Newtonsoft.Json 4.0.8.0. At the same time I am trying to use a newer version of Ext.Net 2.1 to build some modules which requires Newtonsoft.Json 4.5.0.0.

由于在两种情况下,DLL的名称相同,大部分我得到关于类型是在这两个DLL的错误提供同类型和/或错误的版本被加载。

Since in both cases the DLL's have the same name and most of the same types I am getting errors about types being available in both DLL's and/or the wrong version is loaded.

如何我用Ext.Net 2.1 DynamicDashboards和解决冲突?
我没有为DynamicDashboards源,我确实有Ext.Net和Newtonsoft.Json源。

How can I use DynamicDashboards with Ext.Net 2.1 and resolve the conflicts? I do not have the source for DynamicDashboards, I do have the source for Ext.Net and Newtonsoft.Json.

推荐答案

参考这两个组件。在解决方案资源管理器中选择每个并查看属性。应该有一个别名属性。通常它被设置为全球,但你可以改变和/或添加到这一点。例如调用第一个引用 LIB1 第二 LIB2

Reference both assemblies. Select each on in the Solution Explorer and look at the properties. There should be an Aliases property. Usually this is set to global, however you can change and/or add to this. For example call the first reference Lib1 and the second Lib2.

在你的C#则必须把一个外部给它,如:

In your C# you must then put an extern to it, such as:

extern alias Lib1;

您可以然后引用各个组件,如:

You can then reference each individual assembly, like this:

Lib1::Some.Namespace.Type
Lib2::Some.Namespace.Type

如果您想的这更好的解释看这个博客帖子 - 的 http://www.lloydkinsella.net/2012/07/13/extern-alias-underused-or-unknown/

If you'd like a better explaination of this read this blog post - http://www.lloydkinsella.net/2012/07/13/extern-alias-underused-or-unknown/

这篇关于在使用两个SDK的一个ASP现场使用两种不同的版本相同的DLL的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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