我正在尝试创建一个generc vb.net导入程序我在dll中使用此方法加载但是我无法弄清楚如何在完成后卸载dll。有人可以帮助它只是挂在内存中,当然无法在任务管理器中看到它所以有一种方法来关闭后的dll
Public Shared Function CreateInstance(ByVal Plugin As AvailablePlugin) As Object
Dim objDLL As [Assembly]
Dim objPlugin As Object
Try
'Load dll
objDLL = [Assembly].LoadFrom(Plugin.AssemblyPath)
'Create and return class instance
objPlugin = objDLL.CreateInstance(Plugin.ClassName)
Catch e As Exception
Return Nothing
End Try
Return objPlugin
End Function