Using Visual Studio 2008 and .NET 3.5 SP1, adding a WindowsFormsHost control to my WPF application changes its behavior when exceptions are thrown.
I created a fresh WPF application and used the following code in the Window1 class:
//this.Content = new System.Windows.Forms.Integration.WindowsFormsHost();
this.Loaded += new RoutedEventHandler(Window1_Loaded);
void Window1_Loaded(object sender, RoutedEventArgs e)
throw new NotImplementedException();
Running the program without debugging (ctrl-f5) results in the standard "Sorry, this program had to close" crash dialog, as expected.
If I uncomment the WindowsFormsHost line, however, and run the program without debugging, no crash dialog appears. The program window is still visible and can be interacted with.
Why does this happen? And is there any way to get normal behavior back while using a WindowsFormsHost?
View Complete Post