5

Specifically, we are trying to upgrade our telerik controls to the latest version. Unfortunately, the old DLL's are so old that many of the control properties have changed vastly so we've decided to upgrade only the telerik control that is giving us problems (the RadEditor control).

So the bin looks something like this:

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)

The problem is that all the namespaces and classes are the same from the old DLLs to the new one (Telerik.Web.UI).

Here is the specific error I am getting:

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'

I've considered GAC-ing the new DLL but I am uncertain that this will help the situation. Any help would be greatly appreciated.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
sestocker
  • 3,522
  • 6
  • 27
  • 32

1 Answers1

10

You can use extern aliases (tutorial and reference) to differentiate between them. It's pretty annoying to have to, admittedly - obviously avoid where you can, but at least C# provides a way round it :)

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • Looks like this is a great solution but we are using a website (so we can't alias a DLL - everything is just in the bin). – sestocker Jul 23 '09 at 16:19
  • Hmm... can you change the project type so you have a normal "references" list? Or there may be some way of configuring the reference in web.config... – Jon Skeet Jul 23 '09 at 17:00
  • can you write a dll into bin folder which in turn uses aliases to other dll? – Dexters Jul 23 '13 at 19:54
  • @Dexters: I'm not sure *exactly* what you mean - I suspect you'd be best off asking a new question with lots of details (and showing what you've already tried.) – Jon Skeet Jul 23 '13 at 20:17
  • @JonSkeet yep sorry about that – Dexters Sep 17 '13 at 09:16