473,595 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help: unloading Assembly (DLL)

I want to use assemblies (Window Forms as .dll) so that I can replace the form while the main application is running. To accomplish this, I used Assembly.LoadFo rm to manually load the assembly when I need it from a .DLL file. I then use CreateInstance to create the instance of the class, and then use the instance like I would use is with a normal design-time included assembly.

But the problem is, no matter how I try with closing the form, assigning the instance to Nothing and calling garbage collection I can't get the application to release the DLL so I can overwrite it.

Anyonne have a solution for this? I would really appreciate some help.
Jul 21 '05 #1
1 1620
An assembly can only be unloaded by unloading the appdomain it is loaded in.
You will need to create a new appdomain and load the assembly up into the
context in the appdomain.

"LilleSkutt " <an*******@disc ussions.microso ft.com> wrote in message
news:D1******** *************** ***********@mic rosoft.com...
I want to use assemblies (Window Forms as .dll) so that I can replace the form while the main application is running. To accomplish this, I used
Assembly.LoadFo rm to manually load the assembly when I need it from a .DLL
file. I then use CreateInstance to create the instance of the class, and
then use the instance like I would use is with a normal design-time included
assembly.
But the problem is, no matter how I try with closing the form, assigning the instance to Nothing and calling garbage collection I can't get the
application to release the DLL so I can overwrite it.
Anyonne have a solution for this? I would really appreciate some help.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1837
by: Arthur Roodenburg | last post by:
Hello, I would like to unload an assembly after I finished my stuff. I tried to load the assembly in to an AppDomain like this: AssemblyName asmName = AssemblyName.GetAssemblyName(fullFileName); Assembly asm = helpAppDomain.Load(asmName);
1
2023
by: Microsoft | last post by:
Hi all, I have some application which dynamically loads a module as a DLL Assembly. Both are written in C#. I also would like to be able to dynamically unload this assembly (i.e. to update the module with a newer version). How can I do that ? I used this code to load the module : // create instance for module
0
1511
by: Jie | last post by:
Does anyone know why I keep having the following error. I have to rebuild the solution every time I run it in design mode. thanks jie Server Error in '/ReapPortal' Application. ---------------------------------------------------------------------------- ---- Compilation Error
8
1698
by: Chris | last post by:
Hi, All my websites and webservices are down. I get the following message Server Error in '/mywebservices' Application. -------------------------------------------------------------------------------- Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
1
256
by: LilleSkutt | last post by:
I want to use assemblies (Window Forms as .dll) so that I can replace the form while the main application is running. To accomplish this, I used Assembly.LoadForm to manually load the assembly when I need it from a .DLL file. I then use CreateInstance to create the instance of the class, and then use the instance like I would use is with a normal design-time included assembly. But the problem is, no matter how I try with closing the form,...
3
4392
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
12
1894
by: Karina | last post by:
Hello: I am taking over someone else's code and my users are experiencing tons of problems but when I try to go into the source code to edit and try to fix these problems, I realize that all the old programmer's code is in DLLs so I cannot access the source from anywhere. It's really becoming a problem. So..my question is twofold, is there a way to extract the code from the DLL (probably not), if not, what are some other options I...
2
11711
by: sambo251 | last post by:
After running a few updates I get this very annoying "Windows Installer" error #1706 that will ne go away! It keeps saying that it cannot find the file "instantsharedevices.msi", that it is on another CD, and gets caught in a loop when I try to delete it! It mentions MS.net frame error # 1706. The "details" code follows...hope someone can help me to either fix it or get out of the loop! I tried running "Windows Registry Repair Pro"...but no help...
2
5553
by: Tim | last post by:
Hello, I've finally managed to remotely load a DLL. I've expanded the code to load it in a seperate domain to unload the appdomain, which works to a certain extend. The host application always keeps the entry DLL in memory. How can I also unload this main DLL? As it's left after unloading the appdomain. The dll is loaded in the hostapplication at "Assembly assembly = appdom.Load(RawAssembly)".
0
7957
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8262
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8252
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5839
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5421
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3875
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2391
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.