Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何允许两个DLL';是否在同一应用程序中存在具有相同namespace.class的?_C#_Asp.net_Dll_Compiler Construction_Yellow Screen Of Death - Fatal编程技术网

C# 如何允许两个DLL';是否在同一应用程序中存在具有相同namespace.class的?

C# 如何允许两个DLL';是否在同一应用程序中存在具有相同namespace.class的?,c#,asp.net,dll,compiler-construction,yellow-screen-of-death,C#,Asp.net,Dll,Compiler Construction,Yellow Screen Of Death,具体来说,我们正在尝试将telerik控件升级到最新版本。不幸的是,旧的DLL太旧了,许多控件属性都发生了巨大的变化,因此我们决定只升级给我们带来问题的telerik控件(RadEditor控件) 所以垃圾箱看起来像这样: RadChart.Net2.dll RadEditor.Net2.dll (we want to get rid on only this one) RadGrid.Net2.dll RadInput.Net2.dll RadPanelbar.Net2.d RadSpell.

具体来说,我们正在尝试将telerik控件升级到最新版本。不幸的是,旧的DLL太旧了,许多控件属性都发生了巨大的变化,因此我们决定只升级给我们带来问题的telerik控件(RadEditor控件)

所以垃圾箱看起来像这样:

RadChart.Net2.dll
RadEditor.Net2.dll (we want to get rid on only this one)
RadGrid.Net2.dll
RadInput.Net2.dll
RadPanelbar.Net2.d
RadSpell.NET2.dll
RadTabStrip.Net2.d
RadToolbar.Net2.dl
RadTreeView.Net2.d
RadUpload.Net2.dll
RadWindow.Net2.dll
Telerik.Web.UI.dll (this is the new DLL)
问题是,从旧DLL到新DLL(Telerik.Web.UI),所有名称空间和类都是相同的

以下是我得到的具体错误:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0433: The type 'Telerik.Charting.ChartSeries' exists in both 'c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\c6516654\63e1c826\assembly\dl3\9aa96a66\00ba04b3_fd85c701\RadChart.Net2.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\c6516654\63e1c826\assembly\dl3\8fdb0e6c\001aa55c_c4f9c901\Telerik.Web.UI.DLL'

我已经考虑过使用新的DLL,但我不确定这是否有助于解决这个问题。非常感谢您的帮助。

您可以使用外部别名(和)来区分它们。诚然,不得不这样做很烦人——显然要尽量避免,但至少C#提供了一种解决方法:)

看起来这是一个很好的解决方案,但我们使用的是一个网站(所以我们不能别名DLL——一切都在垃圾箱中)。嗯。。。您能否更改项目类型以获得正常的“参考”列表?或者可以通过某种方式配置web.config中的引用……你能将一个dll写入bin文件夹,然后使用其他dll的别名吗?@Dexters:我不确定你的确切意思-我想你最好问一个有很多细节的新问题(并展示你已经尝试过的内容。)@JonSkeet yep对此表示抱歉