First, please see my comment about your questionable practice of using "Debug" and "Release" configurations. (The proper term for them in "
Configuration", not "mode".)
This is not how such things are done. All configurations are in fact custom. "Debug" and "Release" are only suggested names, for example, included by Visual Studio in all project templates. You can have your own. So, if you really need two different configurations which differ not by debug options but something else, you need create 4 (four) configurations.
For example, you need to essentially different (as you say, "intentionally not compatible") configurations, named let's say, "Basic" and "Advanced", you should create configurations like "Basic Debug", "Basic Release", "Advanced Debug" and "Advanced Release". The pairs of "* Debug" and "* Release" configurations still must be differ only in debug options (and XML Documentation maybe), nothing else.
Now, there can be various causes for your particular problem; it's very hard to say what exactly without having your code. However, you cannot talk about C++/CLI at all if you don't use "
/clr
" option.
Your observations on exception handling under Visual Studio depend not only on you code, but also on the options you can find in [Visual Studio Main Menu] => Debug => Exceptions. Please review them. To see how your code really handle exception, try to run it stand-along. Basically, to handle all exceptions in order to prevent termination of the process, you need to catch all exceptions on the very top of the stack of each thread. In case of UI, you also need to catch all exceptions inside the main event loop of the application. Both
System.Windows.Forms.Application
and WPF
System.Windows.Application
provide respective modes for that and exception handling; you only need to handle thread exception handling events:
System.Windows.Forms.Application.ThreadException
and
System.Windows.Application.DispatcherUnhandledException
. See:
http://msdn.microsoft.com/en-us/library/system.windows.forms.application%28v=VS.100%29.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.onthreadexception.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.windows.application.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.windows.application.dispatcherunhandledexception.aspx[
^].
—SA