[Assembly].LoadFrom problem

s3ng

New member
Joined
May 8, 2007
Messages
1
Programming Experience
Beginner
I 'm create a new window application that using [Assembly].LoadFrom to load other program form (.DLL source).
My problem is when i close that form that point to DLL Source, my program still hold the link to that DLL source. I want to dispose or close the DLL Source link when i close that form. So do anybody got idea how to dispose or close it without close my ?
Below is my coding:

strTargetAssembly = "WindowsApplication3.dll"
strAppPath = "C:\Documents and Settings\S3NG\Desktop\WindowsApplication3\WindowsApplication3\bin\Debug"
Dim A As [Assembly] = [Assembly].LoadFrom(strAppPath & "\" & strTargetAssembly)
frmObject = A.CreateInstance(
"WindowsApplication4." & "Form1")
frmObject.Show()

Thanks
S3ng
 
Either load the dll in its own appdomain and then unload the domain, or read the file into an array of bytes, then attach a memorystream to the array and call Assembly.Load on that. You cant unload an assembly loaded with Assembly.Load though
 
Back
Top