Home > Windows Phone > A first chance exception of type ‘System.Windows.Markup.XamlParseException’ – WP8

A first chance exception of type ‘System.Windows.Markup.XamlParseException’ – WP8

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

XamlParseException

XamlParseException

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
Add Exception

Add Exception

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

🙂

Advertisement
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: