anyway to unload the dll

G

Guest

Hi,

I'm using vb.net vs2005 to development an mobile device application. I need
to call a dll in the program but i discovery that the resource of the dll is
not free after using it. Is there any way to free the dll?

Thanks!
 
M

Michel Posseth [MCP]

How did you discovered that the resources are not free after usage ??


Not that after unloading objects the memory footprint will not be inmediatly
smaller , the framework will reserve the memory for future usage , unless
the system is running low on resources the memory will not be given back to
the system

regards

Michel Posseth [MCP]
 
O

Oenone

Michel said:
How did you discovered that the resources are not free after usage ??

Presumably because the DLL file on disk is locked. We have the same issue
here, the application must be closed before the lock is released. This is
only a problem in WinForms based apps, due to the excellent DLL shadowing
feature in ASP.NET.

I'd like to know if there's a workable solution to this problem too...
 
M

Michel Posseth [MCP]

Aha , now we are getting somewhere :)

I asumed we were discussing resources in terms of memory , and now i
understand we are talking about IO locks
I'd like to know if there's a workable solution to this problem too...

I guess there is , you could dynamicly load and unload your objects i guess
this would lock and unlock the file

We are thus talking about "Reflection at runtime"

a simple example ? : ( i am gonna write this on a comp without dev
environment , just out of my plain head so excuse me for anny typo`s :- )

Dim ObjType as Type
=Assembly.getexecutingAssembly().Gettype("assemblyname.objectname")
Dim Obj as object = Activator.CreateInstance(Type)

obj now holds an instance of the class

please note that this is a sort of equivalant to "late binding" , so the
execution speed will be slower as a direct referenced assembly


regards

Michel Posseth [MCP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top