473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Problem With Assembly.Load

Ram
Hey,
I have a windows application that uses Assembly.Load to get information on
certain Assemblies.
But the problem is, that after the Load, even after I clean the object (set
it to null), I cant access (physically) the assembly I loaded - I keep
getting:
"The Process Cannot Access The File Because It Is Being Used By Another
Process".
And nothing I do realease the assembly, - the only thing that works is to
close the application lol...
Is there a way to release the loaded assembly?
Thanks ahead

--Ram

Nov 21 '05 #1
2 1625
Hi Ram,

No, once an assembly is loaded into an appdomain, it can not be unloaded,
you must destroy the appdomain (i.e., close the application). But you can
load the assembly into a secondary appdomain:

AppDomains and Dynamic Loading
http://msdn.microsoft.com/library/de...rp05162002.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Ram" <ni***@bezeqint.net> escribió en el mensaje
news:uG**************@TK2MSFTNGP10.phx.gbl...
Hey,
I have a windows application that uses Assembly.Load to get information on
certain Assemblies.
But the problem is, that after the Load, even after I clean the object
(set
it to null), I cant access (physically) the assembly I loaded - I keep
getting:
"The Process Cannot Access The File Because It Is Being Used By Another
Process".
And nothing I do realease the assembly, - the only thing that works is to
close the application lol...
Is there a way to release the loaded assembly?
Thanks ahead

--Ram

Nov 21 '05 #2
"Ram" <ni***@bezeqint.net> schrieb:
I have a windows application that uses Assembly.Load to get information on
certain Assemblies.
But the problem is, that after the Load, even after I clean the object
(set
it to null), I cant access (physically) the assembly I loaded - I keep
getting:
"The Process Cannot Access The File Because It Is Being Used By Another
Process".
And nothing I do realease the assembly, - the only thing that works is to
close the application lol...
Is there a way to release the loaded assembly?


You'll have to work with a secondary AppDomain and remote interfaces:

<URL:http://www.west-wind.com/presentations/DynamicCode/DynamicCode.htm>
-> "Understanding how .Net loads code"

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

2
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload....
1
by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
2
by: Razzie | last post by:
Hey all, I'm working on this project where I'm dynamically loading an assembly. Basically what I want is that I can just replace my old dll file with a new one without having to do anything...
1
by: Ram | last post by:
Hey, I have a windows application that uses Assembly.Load to get information on certain Assemblies. But the problem is, that after the Load, even after I clean the object (set it to null), I...
1
by: Russ | last post by:
Can anyone please explain what the following means, and how to debug? Everything was working fine and suddenly nothing is working due to this failure. I thought it was due to a DLL mismatch in the...
1
by: mathlec | last post by:
I'm struggling with an odd problem and I want to validate something. What is the right way to load an assembly from bytes? Is this code correct? : .... Private Function loadBytes(filename...
6
by: Steve | last post by:
I'm playing with late binding and trying a very simple test to load an assembly In my "Host" application I have this code: <code> string modulePath =...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
3
by: Peter | last post by:
Hi I can create types from dynamic loaaded assemblies (Assembly.Load) with Assembly.GetTyp( <typename) - OK I need a reference to the assembly (just Type.GetType() do not work ) now my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.