Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. AppDomain for unloading an assembly

AppDomain for unloading an assembly

Scheduled Pinned Locked Moved C#
tutorialvisual-studiocomquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elektrowolf
    wrote on last edited by
    #1

    Hi! this[^] MSDN page told me, I couldn't unload assemblies except I load them into an extra AppDomain and then unload the whole AppDomain. But how to do this? Can someone might give me a little example? EDIT: I want to load the assembly from a file. Thanks in advance, Eric

    S 1 Reply Last reply
    0
    • E elektrowolf

      Hi! this[^] MSDN page told me, I couldn't unload assemblies except I load them into an extra AppDomain and then unload the whole AppDomain. But how to do this? Can someone might give me a little example? EDIT: I want to load the assembly from a file. Thanks in advance, Eric

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      http://msdn.microsoft.com/en-us/library/yb506139.aspx[^] See the links on "How to Create...", "How to unload..." and "How to load assemblies into..."

      Simon

      E 1 Reply Last reply
      0
      • S Simon P Stevens

        http://msdn.microsoft.com/en-us/library/yb506139.aspx[^] See the links on "How to Create...", "How to unload..." and "How to load assemblies into..."

        Simon

        E Offline
        E Offline
        elektrowolf
        wrote on last edited by
        #3

        In "How to load assemblies into..." I can only read how to load assemblies into the current AppDomain, which isn't very helpful.. :^)

        S 2 Replies Last reply
        0
        • E elektrowolf

          In "How to load assemblies into..." I can only read how to load assemblies into the current AppDomain, which isn't very helpful.. :^)

          S Offline
          S Offline
          Simon P Stevens
          wrote on last edited by
          #4

          It's not very obvious I'll admit: "Methods such as CreateInstance and CreateInstanceAndUnwrap of the AppDomain class can load assemblies into an application domain."

          Simon

          1 Reply Last reply
          0
          • E elektrowolf

            In "How to load assemblies into..." I can only read how to load assemblies into the current AppDomain, which isn't very helpful.. :^)

            S Offline
            S Offline
            Simon P Stevens
            wrote on last edited by
            #5

            If you look in the method details for CreateInstanceAndUnwrap it includes an example for running code in a different appdomain. (You should note that the assembly that contains the object you create with CreateInstanceAndUnwrap will be loaded into both appdomains, but you can use the object to load further assembiles only into the domain the code is running in. See the CreateInstanceAndUnwrap[^] page)

            Simon

            E 1 Reply Last reply
            0
            • S Simon P Stevens

              If you look in the method details for CreateInstanceAndUnwrap it includes an example for running code in a different appdomain. (You should note that the assembly that contains the object you create with CreateInstanceAndUnwrap will be loaded into both appdomains, but you can use the object to load further assembiles only into the domain the code is running in. See the CreateInstanceAndUnwrap[^] page)

              Simon

              E Offline
              E Offline
              elektrowolf
              wrote on last edited by
              #6

              Great! Works now... Thx :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups