Solved

Unloading .NET dlls

Posted on 2002-06-29
5
536 Views
Last Modified: 2006-11-17
I wrote a program that needs to be able to get new versions of it's own dll's through the internet.
The problem is that the old dlls which are used by the program are locked. I want to unload them, copy the new dlls, and then load them back for use by the program.

If it isn't prossible I'll probably have to write a second program which performs the update by shutting down my app, doing the dll update and then start my app again... But I really prefer doing it all in one app...

0
Comment
Question by:ArielLaub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 7118896
The second program aapproach is normally being done.

You should:
- close the app.
- start the new app, initialize / copy all dll's.
- start the app again.

There is no other way.

CJ
0
 

Expert Comment

by:Fesersoft
ID: 7118904
If you load the Original Assembly into a different AppDomain, you can destroy the Appdomain and the Assembliesw will be released and can be removed or refreshed from the internet.
0
 

Author Comment

by:ArielLaub
ID: 7120040
You are probably right, but I still need a second program to do this. a program cannot unload itself and then reload it...
0
 
LVL 1

Expert Comment

by:Tim_Musschoot
ID: 7120795
Hello,

Try to copy the new DLL's over the old versions.  It works fine for me...

Regards,
Tim
0
 
LVL 4

Accepted Solution

by:
CoolAss earned 100 total points
ID: 7130627
A single application (aka a single process) can have multiple AppDomains.

I suggest placing all updatable assemblies in a second AppDomain, and reserve the first AppDomain for the assemblies that contains the code that is responsible for updating the application.

Also, check out this article about self-updating applications:

http://www.gotdotnet.com/team/windowsforms/appupdater.aspx
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question