I have a custom code library (.dll) where I store controls and shared procedures that I’ve written. Two of the controls in my library reference a 3rd party .net assembly (.dll).
Using my custom library, I have another assembly (.exe). Currently I have my custom library added as a resource to my exe, and I load it using the AssemblyResolve event as shown below:
Public Sub New() ‘The constructor for the main form in my exe
AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf Domain_AssembilyResolve
' This call is required by the designer.
' Add any initialization after the InitializeComponent() call.
Private Function Domain_AssembilyResolve(sender As Object, args As System.ResolveEventArgs) As System.Reflection.Assembly
If InStr(args.Name, "MyLibrary") Then Return Assembly.Load(My.Resources.MyLibrary)
The problem comes in here. I want to load the 3rd party dll along with mine, without having to add it as a resource to my main executable. In other words, I want to embed the 3rd party dll in my custom library import them both.
The reason for this is that if I don’t do it this way, I’ll have to embed the 3rd party dll in any project which uses my dll. This isn’t crustal just convenient. Can it be done?