How can I catch a Side-By-Side (SxS) manifest load error without crashing on startup?

165 Views Asked by At

I have a C++ application which uses controls contained in a managed (C#) library.

The controls are activated using Registry-Free COM Interop (SxS activation).

If the managed library is missing, the application shuts down immediately with a generic and unhelpful dialog:

("Unable to start program X", "This Application has failed to start... blah...blah")

What I would like to do, is catch the error and present the user with my own (hopefully more helpful) message. Better yet, I would like to allow the application to continue loading and just disable the few dialogs that actually use the managed library and its controls (only a tiny fraction of the main application uses this library).

Unfortunately, the error from the SxS loader seems to happen before any of my code gets a crack at handling it.

Can I catch and handle these errors? If so, how?

Thanks!

0

There are 0 best solutions below