Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to use two different incompatible versions of an assembly in DNN?How to use two different incompatible versions of an assembly in DNN?
Previous
 
Next
New Post
5/8/2014 1:31 PM
 

If two DNN modules are using two different incompatible versions of an assembly, how would the two modules coexist in the same DNN instance? A real world example is a module using Entity Framework version 5.0 and another using using version 6.1. Module version 5.0 vendor has no plans to upgrade. EF 5 and 6.1 are not 100% compatible. Installing both in the GAC or even one is not an option because third party shared hosting is used.

I read about loading a specific assembly at runtime but I am not sure that works still because two versions can't be used in the same appdomain.

Another question is.. does DNN check for version numbers and give a warning when it tries to install a module with an assembly which already exists in the BIN folder of a different version or does it just blindly overwrite the existing one? Because that can break the existing module if the two versions are not compatible.

 

 

 
New Post
5/8/2014 6:11 PM
 

essentially you can't - only one version of a particular assembly can exist in an application domain at any one time. If you load one, either declaratively or dynamically (either from bin or GAC, it doesn't matter), when you stop using it, it will still remain in the app domain and only an application domain recycle will remove it, so an attempt to load a 2nd (different) version of the assembly will fail.

In general, the best way to deal with 2 different versions of the same assembly is to use assembly binding redirects - where the request for an older version if "forwarded" to the newer version. You can see us using this in DNN with the telerik assemblies for instance. However this relies on the binding assembly redirect to exist, and that the newer assembly version is binary compatible with the older one, which is not always the case as some assemblies break compatibility.

As for assembly versions, yes, dnn does check for this -as long as the extension developer has correctly built their module i.e. to use an assembly component (http://www.dnnsoftware.com/wiki/page/...) as this allows for versioning and referencing counting and ensures the older versions cant overwrite etc.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
5/9/2014 12:53 PM
 
The forwarding is not going to be an option for EF if the two versions are not compatible.

As for the manifest, DNN should give a info message (if it does not) that the older version has been replaced by the new version during the module installation. The module which was using the older version might break and the admin has to figure out what happened which might take a long time to troubleshoot. The info message would ease that pain.
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to use two different incompatible versions of an assembly in DNN?How to use two different incompatible versions of an assembly in DNN?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out