I have a .NET Framework 4.6.2 application myApp.exe
with several internal and external dependencies. All dependencies are included into the main application myApp.exe
as resources.
On application startup, our custom assembly loader gets notified via the event AssemblyResolve
and loads the requested assembly from myApp.exe
's resources via GetManifestResourceStream()
and Assembly.Load()
.
This works fine, except App.config
: the resources contain myApp.App.config
, but the custom assembly loader is not loading it yet. This leads to a problem because all the assembly binding redirects specified in App.config
are not applied by the .NET Runtime. When placing myApp.exe.config
beside myApp.exe
(as usual in .NET), everything is working fine.
I'm trying to find a way to avoid the additional file myApp.exe.config
. Instead, I want to load the app config (especially the binding redirects) from the resources as well. Is that even possible? If yes, how can I do so?