开发者

How to avoid Assembly.LoadFrom blocking?

开发者 https://www.devze.com 2023-03-25 10:42 出处:网络
I create a .net dll on the fly with codedom then I load it with Assembly.LoadFrom like this: Private Sub Test()

I create a .net dll on the fly with codedom then I load it with Assembly.LoadFrom like this:

Private Sub Test()
    Dim ASM As Assembly = Assembly.LoadFrom("test.dll")
'Do some stuff with the loa开发者_Go百科ded assembly...
End Sub

it works only once. If I try to recompile the test.dll i get the error that the file is used and not writable. I tried to set ASM to nothing - how can I unload the loaded Assembly from the memory?


Loaded assemblies can only be unloaded by destroying the AppDomain in which they are loaded. Review the How To article links on this MSDN Library page.

0

精彩评论

暂无评论...
验证码 换一张
取 消