Question Details

No question body available.

Tags

vb.net automation pid

Answers (1)

February 4, 2026 Score: 2 Rep: 62 Quality: Low Completeness: 60%

You can add .Net assemblies as a resource and in the ApplicationEvents.vb file add a handler to resolve them to those resources

Namespace My
    ' The following events are available for MyApplication:
    ' Startup: Raised when the application starts, before the startup form is created.
    ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
    ' UnhandledException: Raised if the application encounters an unhandled exception.
    ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
    ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
    Partial Friend Class MyApplication

Private Sub AppStart(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf ResolveAssemblies End Sub

Private Function ResolveAssemblies(sender As Object, e As System.ResolveEventArgs) As Reflection.Assembly Dim desiredAssembly = New Reflection.AssemblyName(e.Name)

If desiredAssembly.Name = "Ookii.Dialogs.WinForms" Then Return Reflection.Assembly.Load(My.Resources.OokiiDialogsWinForms) 'replace with your assembly's resource name Else Return Nothing End If End Function

End Class End Namespace

It is important to note this only works for .Net dlls