There are two potential causes of this.
-
The most common is the x:Class doesn’t match up with the MainPage.xaml namespace. Make sure that x:Class in MainPage.xaml has the correct namespace.
-
The second most common cause of this problem is that the “Build Action” is not set to “Page” for MainPage.xaml!