Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Visual Studio 2017: Cannot Add Cross-Platform View Page

So I use the Xamarin Cross-Platform application template. I want to add LoginPage.xaml view to my project. So I choose add -> new item -> contentpage.

There is always error:

The project system has encountered an error:

Did not find new element in the hierarchy for item "Views\LoginPage.xaml". The item would have been added with type "Page". The project item schema service knows about this item type. The item does exist in the project file.

After I close the error. There is another error:

Microsoft Visual Studio

Exception of type "System.Exception" was thrown.

Then what happenend next is the "LoginPage.xaml" file is created but not included in the project (it is hidden). I cannot include it in my project because it keeps refusing. There is no xaml.cs file created.

How can I fix this?

like image 723
Alvin Stefanus Avatar asked Dec 10 '25 15:12

Alvin Stefanus


1 Answers

This issue is officially "Under Investigation" (reported and answered: https://developercommunity.visualstudio.com/content/problem/160939/bug-adding-xaml-content-page-to-shared-project-xam.html) and there is a workaround:

a workaround is to install the Universal Windows Platform development workload

like image 118
Niklas Teich Avatar answered Dec 13 '25 06:12

Niklas Teich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!