Let\'s say I have a library Lib.dll, which uses Castle.Windsor to initialize its services.
I have a main application App.exe, which loads Lib.dll on runtime using re
You probably can't do it in easy and elegant way if App.exe doesn't provide you Castle Windsor's container instance to configure your services.
If it is not exposed directly, maybe you can access it using Service Locator? Or find it on your own using reflection on App.exe assembly?
The best solution will be if code in App.exe calls specific method in your library (i.e. it can look for particular interface implementation, like IModuleInitializer or something, create an instance of it and call some kind of Initialize method passing container instance to your code).
You could also think about extensibility frameworks like MEF, but that can be a bit overkill and make big influence on App.exe.