XAML Error: The name ‘InitializeComponent’ does not exist in the current context

XAML Error: The name ‘InitializeComponent’ does not exist in the current context

XAML designer is full of surprise so get ready for Binging … When you get below error then just remove Default constructor with InitializeComponent() call and everything will be fine.

When I had UserControl on my main Windows Phone Project I was not getting error. But suddenly I copied it to Class Library Project and didn’t like my  InitializeComponent() in default constructor  created when user control was added.

Here is the error.

The name ‘InitializeComponent’ does not exist in the current context

To fix it remove below code from your file.

        public MyUserControl()
        {
            InitializeComponent();
        }

Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.

Leave a Reply