Load and unload DLL's. Possible?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ivan

    Load and unload DLL's. Possible?

    Hello,

    What I want to do is to create DLL that I can load and use and then unload
    when needed.
    What I mean by this is: After object released - dll file can be removed,
    etc. So, file won't be blocked.
    Now I use regular EXE and pass command line but I need to pass objects, so
    EXE doesn't work well anymore.

    Thank you,
    Ivan

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Load and unload DLL's. Possible?

    Ivan,

    Generally, if you load the assembly manually, you won't be able to
    unload the assembly unless you unload the entire app domain. To get around
    this, you would usually spin up a new app domain and then create the object
    in that domain, and then unload the domain when done.

    You can use the classes in the System.AddIn namespace now to do what you
    want though, as opposed to rolling this all yourself.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Ivan" <ivan@mailgroup s.microsoft.com wrote in message
    news:3DDD2CAC-1DD7-45CC-B433-96C7561A4268@mi crosoft.com...
    Hello,
    >
    What I want to do is to create DLL that I can load and use and then unload
    when needed.
    What I mean by this is: After object released - dll file can be removed,
    etc. So, file won't be blocked.
    Now I use regular EXE and pass command line but I need to pass objects, so
    EXE doesn't work well anymore.
    >
    Thank you,
    Ivan

    Comment

    Working...