Share via


An unhandled exception has occurred

When you work with a XAML file in the Windows Presentation Foundation (WPF) Designer for Visual Studio, Design view is updated automatically. If a XAML file accesses code that contains an exception, Design view cannot be updated. For example, a XAML file might contain a custom control that contains an exception. This problem can be displayed to the user in Design view or the Information bar. 

Design View

If the XAML file is closed and you open it, the following message appears in Design view of the WPF Designer:

An unhandled exception has occurred.

Click here to reload the designer

Details:

The Details box contains information about the type of exception and where in the code it occurred. You must edit the code that the XAML accesses to correct the exception, and then you can click Click here to reload the designer to update the designer.

Information Bar

If the XAML file is already open, the following message appears in the Information bar of the WPF Designer:

An unhandled exception has occurred. Click here to reload.

You must edit the code that the XAML accesses to correct the exception, and then you can click the Information bar to update the designer.

See Also

Concepts

Troubleshooting WPF Designer Load Failures

XAML Errors and Help

Other Resources

Debugging and Interpreting Errors in the WPF Designer

Error Message Reference for the WPF Designer

Debugging and Interpreting Errors Walkthroughs