0

I am trying to create a generc vb.net import program I am loading in the dlls usings this method But I cant figure out how to unload the dll once finished with it . Can someone help it just hangs in memory and of course cant see it in task manager so nead a way to close the dll after

  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
c-sharp-and-swiftui-devni
  • 3,743
  • 4
  • 39
  • 100

0 Answers0