none
OSGI Equivalent RRS feed

  • Question

  • Is there any thing in .net 2010 equivalent to OSGI?

    Is there a way to replace dlls without stopping the application?


    Raamakarthikeyan

    Wednesday, July 10, 2013 1:27 PM

Answers

  • Perhaps AppDomains would be what you're looking for?

    See http://msdn.microsoft.com/en-us/library/system.appdomain.aspx

    AppDomains can be dynamically loaded and then assemblies dynamically loaded into them. An AppDomain can be Unloaded as well, which may allow you to replace the assemblies that were used within it without requiring the entire process to be stopped.


    • Proposed as answer by Heslacher Wednesday, July 10, 2013 1:55 PM
    • Edited by RJP1973 Thursday, July 11, 2013 8:42 AM Corrected http path
    • Marked as answer by Damon Bu - MSFT Wednesday, August 7, 2013 2:08 AM
    Wednesday, July 10, 2013 1:45 PM

All replies

  • Perhaps AppDomains would be what you're looking for?

    See http://msdn.microsoft.com/en-us/library/system.appdomain.aspx

    AppDomains can be dynamically loaded and then assemblies dynamically loaded into them. An AppDomain can be Unloaded as well, which may allow you to replace the assemblies that were used within it without requiring the entire process to be stopped.


    • Proposed as answer by Heslacher Wednesday, July 10, 2013 1:55 PM
    • Edited by RJP1973 Thursday, July 11, 2013 8:42 AM Corrected http path
    • Marked as answer by Damon Bu - MSFT Wednesday, August 7, 2013 2:08 AM
    Wednesday, July 10, 2013 1:45 PM
  • The link that you gave me says content not found. Is there any other link?

    Whenever we invoke an application, it runs in an appdomain right? Then why does we need to create an another appdomain?


    Raamakarthikeyan

    Thursday, July 11, 2013 6:29 AM
  • Just remove the comma at the end.

    Hannes

    If you have got questions about this, just ask.

    In a perfect world,
    users would never enter data in the wrong form,
    files they choose to open would always exist
    and code would never have bugs.

    My Forum Threads

    Thursday, July 11, 2013 6:44 AM
  • As previous post stated, I had left a comma in the address. Now corrected.

    As to your question, you originally asked about replacing dlls without stopping the application. Normally you would not be able to do this. However, an application can have multiple appdomains and each appdomain has a certain degree of isolation from the rest of the application and can be loaded and unloaded dynamically (obviously you cannot unload the main application appdomain as that would stop the application running).

    Thursday, July 11, 2013 8:45 AM
  • Thank you for explaining it clearly

    I have one question, when a dll is been replaced, when will the existing the running process know a dll is been replaced?


    Raamakarthikeyan

    Thursday, July 11, 2013 12:23 PM
  • I have enabled shadow copy. I am able to update the assemblies and i am seeing the changes with the new process.

    But if there is a change in stored procedure parameter from the assembly how will this apply for my existing running process?


    Raamakarthikeyan

    Thursday, July 11, 2013 3:01 PM