When an exception occurs while running the sample framework, even if it is handled in a global exception try-catch block, the sample framework will throw an unhandled exception on Dispose. To replicate this issue, simply open up the empty project template and change line 238 in EmptyProject.cs from:
effect.SetValue("appTime", (float)appTime);
to (in order to force an exception):
effect.SetValue("appTm", (float)appTime);
Although it perhaps is not the best fix, the quick and dirty fix for this is to change lines 3948-3957 in the Dispose method in Common\dxmut.cs from:
if (Window != null)
{
// If we have a window, use BeginInvoke to start shutdown
Window.BeginInvoke(new DisposeDelegate(this.Shutdown));
}
else
{
// Otherwise, call it directly
Shutdown();
}
to just:
Shutdown();
Happy Programming!