Results 1 to 13 of 13

Thread: Explain how Dll hell is overcome in .net with example

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    37

    Smile Explain how Dll hell is overcome in .net with example

    Hi,

    I have broswed the web and tried to understand the concept of Dll hell and how it has been overcome by .net, but still not clear as it says that can have different versions of assembly running side by side, what does this mean. Can someone explain with coding so that I can and see my self. Does this refer to the different versions of framework or the different versions of visual studio like 2003 or 2005 or are they talking abt the different versions of the project/application..I' so confused. So kindly explain with a sample code if neccessary.

    Thanks!.

  2. #2
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: Explain how Dll hell is overcome in .net with example

    "different versions of assembly running" means different versions of .net framework like 1.1, 2.0, 3.0 on the same machine and you can have VS2003 and work with .net1.1 and VS2005 with 2.0,3.0

    It's up to your project design if you let people install multipul versions of your program or make them upgrade an existing one.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    37

    Smile Re: Explain how Dll hell is overcome in .net with example

    Hi,

    Thanks! for the info. I also want know if assembly is nothing but the .dll that gets created when we build the application. Say for example the project/application name is TOAST, then toast.dll get created in the bin directory in the root folder of TOAST. Correct me if I'm worng.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Explain how Dll hell is overcome in .net with example

    Thread Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Explain how Dll hell is overcome in .net with example

    I believe the assembly is contained within the framework itself and not your application.

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Explain how Dll hell is overcome in .net with example

    Quote Originally Posted by brin351
    "different versions of assembly running" means different versions of .net framework like 1.1, 2.0, 3.0 on the same machine and you can have VS2003 and work with .net1.1 and VS2005 with 2.0,3.0

    It's up to your project design if you let people install multipul versions of your program or make them upgrade an existing one.
    That's not quite what it means either.... If I create a dll in .NET using FW2.0....and deploy it with an app.... then later I take that DLL.... make major mods to it.... then deploy it with ANOTHER app....the two DLLs will happily co-exist side-by-side on the same machine with out affecting each other's apps. THis is because the DLLs are deployed within the app's directory. And neither are actually registered with the system (as the older AxtiveX DLLs were). Since they are not registered with the system, they don't know about each other, and therefor do not create any conflicts with each other.

    The version of the FW doesn't really play into this, it's really more about the versions of the assembies themselves.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Explain how Dll hell is overcome in .net with example

    tg (or anyone else): Is this an accurate statement?
    Quote Originally Posted by Hack
    I believe the assembly is contained within the framework itself and not your application.

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Explain how Dll hell is overcome in .net with example

    Not really.... when you build an assembly, it exists where it does... usually with the app that uses it. Now, if you install it into the GAC (Global Asseembly Cache)... then it has the appearance of being framework, since ANY app at that point could reference it (when you right Click "Add Reference" and click the .NET tab.... everything that's listed is in the GAC) ... And it is possible to have two version of the same assembly in the GAC, provided the Assembly version is different. - that is how the different frameworks are able to co-exist....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Explain how Dll hell is overcome in .net with example

    Ok....I think I understand. Thanks for clearing that up.

  10. #10
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: Explain how Dll hell is overcome in .net with example

    Yes thanks techgnome for your insight.

  11. #11

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    37

    Re: Explain how Dll hell is overcome in .net with example

    Hi All,

    Thanks for all the inputs. But w.r.t my seccond question that is the assembly the dll created in the bin directory of every application or is it a diffent one. How do I create another different version of assembly for the same application and also how to I refer this in another application?. Kindly explain.

    Thanks again.

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Explain how Dll hell is overcome in .net with example

    The default location is the bin folder but its user selectable so it may be different.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Explain how Dll hell is overcome in .net with example

    Quote Originally Posted by nandini_net_in
    Hi All,

    Thanks for all the inputs. But w.r.t my seccond question that is the assembly the dll created in the bin directory of every application or is it a diffent one. How do I create another different version of assembly for the same application and also how to I refer this in another application?. Kindly explain.

    Thanks again.
    First, it's generally not a good idea to have two versions of the same DLL in the same folder... how would the app know which one to use if they both have the same namespaces and classes in them. But if you are trully hell bent on doing so, you would by giving them different names.... myDllv.1.0.0.dll and myDllv1.2.0.dll..... but if they both hold the same class "MyClass" ... how does your app know which one to load? It doesn't.

    As for other apps, same deal, you set a reference to it. Normally, most DLLs when referenced, and are not part of the GAC, get set with the "Copy to Local" to true. Which means, now your app gets a local copy of that DLL... even if it changes, if you don't recompile your app.... and you don't copy the newer version into the app folder, it will use the one right inthe app folder, which is the older version. Maybe this is what you want... maybe it isn't.... that's up to you.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width