This is a migrated thread and some comments may be shown as answers.

Integration with DNN

3 Answers 258 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Massimiliano
Top achievements
Rank 1
Massimiliano asked on 13 Nov 2014, 04:00 PM
Hallo,
DNN (formerly Dot Net Nuke) come shipped with a special modified version of your dll, plus has its own wrappers around Telerik control.
What I would like is being able to buy the complete, full and up to date version of your Ajax suite and use it in my DNN modules.
Now the problem I'm facing is this... since the Telerik dlls are already in the DNN bin folder, but they are modified versions, and so the namespace is already there as well, how can I let live the "commercial full" dlls I will buy for my modules together with DNN ones?

Another commercial question is this. I will make those modules for some of my customers, so they are very customized and not intended for reselling BUT would I be allowed to resell modules built upon the commercial licensed Ajax Suite?

The most important point for me is the first, how to have the DNN custom and official Telerik dlls (+ Namespaces) live together... I looked around for some resurces like the "external" statement (only available in C# I guess but I'm coding in VB.NET at the moment) but I don't know if this is the way to follow.

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 18 Nov 2014, 10:33 AM

Hi Massimiliano,

The modifications DNN has over our controls is the exact reason why we do not support that environment and we cannot provide definitive answers as to how our controls are used there. It is best if you address such queries to the DNN support and/or forums.

What I can suggest as a possible option is to add a bindingRedirect element for the new version, but this is likely to break the existing DNN functionality since the custom classes and wrappers will not be available any longer in the vanilla dlls we provide.

You cannot have two versions of the same assembly (Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll in this case) used in the same project. This is a generic .NET limitation.

As for commercial use - I have forwarded your query to our sales team and they will follow up with you on this matter.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Massimiliano
Top achievements
Rank 1
answered on 18 Nov 2014, 12:14 PM
Hallo Marin, thank you for your answer.
That's really sad beacuse I mean I won't be able to use Telerik (commercial not DNN modified) stuff to develop my modules inside DNN platform.
I hoped there was a way to use different versions of the same libraries together reading the use of the "Extern" directive in C#:
http://blogs.msdn.com/b/abhinaba/archive/2005/11/30/498278.aspx 
0
Marin Bratanov
Telerik team
answered on 18 Nov 2014, 12:52 PM

Hi Massimiliano,

We have not looked into such options and they are not supported. Nevertheless, if you succeed in such an endeavor, I would encourage you to post instructions and snippets in our code library or in a personal blog of yours.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Josh
Top achievements
Rank 1
commented on 04 Aug 2023, 10:33 PM

I was able use two different versions of a dll using the instructions here (in my case it was the old and new versions of bouncycastle.crypto.dll) 

 

https://www.learningsomethingnew.com/how-to-use-two-versions-of-the-same-dll-in-the-same-project 

(pasted link content below in case of future broken link)

-----------------------------------------------------------------------------------------------------------------------------------------------

How to use two versions of the same DLL in the same project

March 25, 2019

When using 3rd party libraries, sometimes they let out a new version. And sometimes that new version breaks something that used to work in the old version, but also adds features you need. So you found yourself having to use one method from the old version and another from the new version of the same library.

The problem

There are two problems here:

  1. It won’t compile. Both libraries have the same namespace, causing ambiguity the compiler can’t handle.

compile-ex

  1. It won’t run. The referenced DLLs are copied to the output dir, but because they have the same name, they will override each other, and will cause the runtime loading of the assembly to have a version mismatch.

runtime-ex

Welcome to DLL hell.

The solution

Let’s take my client’s project as a practical example. The project was using a 3rd party library by Winnovative Software, for handling pdf operations. The new version of the dll broke some specific functionality that had to be supported. The DLL name: wnvhtmltopdf.dll The old version: 14.2 The new version: 14.5

The solution has two parts:

  1. Solve compilation ambiguity with extern alias
  2. Solve runtime loading ambiguity with

Place old DLL in folder

Create a folder for the old DLL, let’s say wnv-old, and put it there. Add a reference to the old DLL.

Solve compilation ambiguity with extern alias

Change the reference aliases:

Every reference we add to the project will have the “global” alias by default. For this duplicate reference we’ll change the alias so we can differentiate the namespaces. In the reference properties in Visual Studio, change the alias field to newVer and oldVer or whatever you want:

runtime-ex

Change the using statements:

Wherever we use the namespace we’ll change the using statements to:

extern alias newVer; // Must be at top of file
using newVer::Winnovative; // Instead of using Winnovative;

And in classes in which you want to use the old version:

extern alias oldVer; 
using oldVer::Winnovative; 

This will make the code compile. Now for solving the runtime crash:

Get DLL publicKeyToken

In cmd, use the sn -T command:

sn -T wnvhtmltopdf.dll

Microsoft (R) .NET Framework Strong Name Utility  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Public key token is b12703d35a33ff98

Modify app.config / web.config

Under <runtime>, add a <codeBase> tag for each version of the DLL. This will resolve the runtime assembly loading conflict.

<dependentAssembly>
  <assemblyIdentity name="wnvhtmltopdf" publicKeyToken="b12703d35a33ff98" culture="neutral" />
  <codeBase version="14.2.0.0" href="DLL\wnv-old\wnvhtmltopdf-old.dll" />
  <codeBase version="14.5.0.0" href="DLL\wnvhtmltopdf.dll" />
</dependentAssembly>

That’s it, now we can use both versions as we please.

Rumen
Telerik team
commented on 07 Aug 2023, 09:11 AM

Thank you for sharing this approach, Joshua! The solution is also used and shared as a description in the Telerik RadGrid and Reporting integration offline demo:

Tags
General Discussions
Asked by
Massimiliano
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Massimiliano
Top achievements
Rank 1
Share this question
or