Xamarin Visual Studio 2017:无法添加跨平台视图页面 [英] Xamarin Visual Studio 2017: Cannot Add Cross-Platform View Page
问题描述
因此,我使用Xamarin跨平台应用程序模板.我想将LoginPage.xaml
视图添加到我的项目中.因此,我选择add -> new item -> contentpage
.
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
.
总有错误:
项目系统遇到错误:
The project system has encountered an error:
在项目的层次结构中找不到新元素 "Views \ LoginPage.xaml".该项目将被添加为type 页".项目项目架构服务知道此项目类型. 该项目确实存在于项目文件中.
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
Microsoft Visual Studio
引发了类型为"System.Exception"的异常.
Exception of type "System.Exception" was thrown.
然后,接下来发生的是创建了"LoginPage.xaml"文件,但该文件未包含在该文件中(已隐藏).我无法将其包含在我的项目中,因为它一直在拒绝.没有创建xaml.cs文件.
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.
我该如何解决?
推荐答案
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:
一种解决方法是安装通用Windows平台开发工作负载
a workaround is to install the Universal Windows Platform development workload
这篇关于Xamarin Visual Studio 2017:无法添加跨平台视图页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!