Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dominik 711 posts 733 karma points
    May 23, 2011 @ 11:00
    dominik
    0

    Use different versions of dlls

    Hello,

    Ive got a question about handling dlls,

    I need a special dll version for an own usercontrol. This needs an older version of the dll umbraco is using (FluentNHibernate.dll).

    Now my question is how can i use different versions of dlls in the bin folder?

    Is there any solution for this problem?

     

     

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    May 23, 2011 @ 11:52
    Michael Latouche
    0

    Hi Dominik,

    I think the following link will help yopu through this: http://geekswithblogs.net/narent/archive/2008/11/11/126940.aspx

    Hope this helps.

    Cheers,

    Michael.

  • dominik 711 posts 733 karma points
    May 23, 2011 @ 13:04
    dominik
    0

    Hi Micheal,

    Thanks for your response.

    One of the dll is used by an umbraco extension (not in an own project).

    In the link you posted above it is discribed how to use two different dll versions in one project.

    Is there any way to use another FluentNHibernate dll version for my local project. If i overwrite the dll the Umbraco extension does not work anymore because it need the newer version of the dll

     

    Thanks

     

     

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    May 23, 2011 @ 14:01
    Michael Latouche
    0

    Hi Dominik,

    Maybe this link will better help you:

    http://stackoverflow.com/questions/2460542/using-different-versions-of-the-same-assembly-in-the-same-folder

    Especially the part:

    that your only option is to merge one of the two versions into 
    the assembly requiring that version. In your specific case, you need 
    Castle.DynamicProxy2.dll v2.1 to be merged into 
    NHibernate.dll You can use a tool called ILMerge to merge the assemblies. The command you will need to run looks something like this (untested):
    ILMerge /t:library /internalize /out:Deploy/NHibernate.dll NHibernate.dll Castle.DynamicProxy2.dll
    The /internalize switch tells ILMerge to mark all types from the second assembly (Castle in this case) internal in the output assembly. Without this, you might get compile errors when you try to compile a project referencing both your new NHibernate.dll and the shelf version of Castle.DynamicProxy2.dll v2.2, as they will contain classes with the exact same names

    Basically, you will have to merge the umbraco assembly with the FluentNHibernate version it needs. Then that assembly can live "on its own", and you can use the other FluentNHibernate assembly within your project.

    Hope this helps,

    Michael.

  • dominik 711 posts 733 karma points
    May 23, 2011 @ 15:14
    dominik
    0

    But how can i get it working without merging.

    Is there any way to use both dlls? Fore example to register one of them in the Global assembly cache? Or using another path for the dll?

     

     

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    May 24, 2011 @ 10:06
    Michael Latouche
    0

    Hi Dominik,

    I think you can indeed register them in the global assembly, but then this will only work if the dll is strong-named. Also, this might become an issue if you are hosting the site at a third-party hosting provider, as you probably wil not have access to the gac out there.

    And this is the link to a post explaining how to put different versions of an assembly in separate folders: http://nerobrain.blogspot.com/2011/04/loading-different-versions-of-same-net.html

    Hope this helps :-)

    Cheers,

    Michael.

  • dominik 711 posts 733 karma points
    May 24, 2011 @ 10:45
    dominik
    0

    Hi Michael,

    The server is not hosted on third party provider so it should be possible but i cant get it working to load the dll from GAC in umbraco

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    May 24, 2011 @ 10:51
    Michael Latouche
    0

    Mmhhh, looks strange to me but I am no expert in umbraco's architecture.

    Did you try the other solution with subfolders? And, also, is there a specific reason why the merging is not an option? At first sight, this looks to me like the "cleanest" solution of the 3. But maybe this brings some other issues I am not aware of.

    Cheers,

    Michael.

Please Sign in or register to post replies

Write your reply to:

Draft