Other day I got below error while executing my application.
A first chance exception of type ‘System.Windows.Markup.XamlParseException’ occurred in System.Windows.ni.dll
The exception was in ‘App.xaml.cs’ file’s InitializeComponent() method

Reason –
- There could be many reasons for the exception
- Even if there is an invalid space in your xaml file it throws the exception
Fix –
- To get the exact reason for the issue, add the exception in your ‘Debug’
- Debug->Exceptions
- Press Add and type in, “System.Windows.Markup.XamlParseException” and select Common Language Runtime Exceptions

- Run the application
- It will pinpoint the exact reason for the exception
- In my case I had an empty space in my xaml file
🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a comment