Consider the following scenario:
- You have a .Net Framework 3.5 Service Pack 1-based Windows Presentation Foundation (WPF) application.
- You call the Application.LoadComponent method to load an Extensible Application Markup Language (XAML) file.
- You set the Application.StartupUri property of the XAML file.
- You set the Visibility property of the window object in the XAML file.
In this scenario, the application crashes when you try to run it. Additionally, if you try to debug the application, you find that an
InvalidOperationException exception was thrown.