建立范本专案时发生错误-行动应用程式(Xamarin Forms)-Visual Studio 2017 [英] Error building template project - Mobile App (Xamarin Forms) - Visual Studio 2017

查看:64
本文介绍了建立范本专案时发生错误-行动应用程式(Xamarin Forms)-Visual Studio 2017的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xamarin Forms应用程序的项目模板不能立即使用吗?只需选择使用Master Detail页面和.Net标准库创建一个新的移动应用程序(Xamarin Forms).这就是结果.

Project template for Xamarin Forms apps don't work out of the box? Simply chose to create a new mobile app (Xamarin Forms) using Master Detail page, and .Net standard library. and this is the result.

BTW在Windows 10 v 1703 OS Build 15063.0上使用全新安装的Visual Studio 2017社区(v 15.8.2).这应该可以工作,我在安装程序中选中了所有正确的选项.

BTW using a brand new installation of Visual Studio 2017 Community (v 15.8.2) on Windows 10 v 1703 OS Build 15063.0. This should be working, I checked off all the right options in the installer.

Severity    Code    Description Project File    Line    Suppression State
Error   CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    2   Active
Error   CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    2   Active
Error   CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    3   Active
Error   CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    3   Active
Error   CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    4   Active
Error   CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    4   Active
Error   CS0246  The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    5   Active
Error   CS0246  The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    5   Active
Error   CS0246  The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    6   Active
Error   CS0246  The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    6   Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    10  Active
Error   CS0246  The type or namespace name 'XamlCompilationAttribute' could not be found (are you missing a using directive or an assembly reference?)  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    10  Active
Error   CS0246  The type or namespace name 'XamlCompilation' could not be found (are you missing a using directive or an assembly reference?)   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    10  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    10  Active
Error   CS0103  The name 'XamlCompilationOptions' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    10  Active
Error   CS0246  The type or namespace name 'MasterDetailPage' could not be found (are you missing a using directive or an assembly reference?)  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    11  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0246  The type or namespace name 'Dictionary<,>' could not be found (are you missing a using directive or an assembly reference?) MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0246  The type or namespace name 'NavigationPage' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0518  Predefined type 'System.Void' is not defined or imported    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    14  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    23  Active
Error   CS0246  The type or namespace name 'Task' could not be found (are you missing a using directive or an assembly reference?)  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    23  Active
Error   CS1983  The return type of an async method must be void, Task or Task<T>    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    23  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    23  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0246  The type or namespace name 'Dictionary<,>' could not be found (are you missing a using directive or an assembly reference?) MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0246  The type or namespace name 'NavigationPage' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    13  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    16  Active
Error   CS0103  The name 'InitializeComponent' does not exist in the current context    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    16  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    18  Active
Error   CS0103  The name 'MasterBehavior' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    18  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    18  Active
Error   CS0103  The name 'MasterBehavior' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    18  Active
Error   CS0518  Predefined type 'System.Enum' is not defined or imported    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0246  The type or namespace name 'NavigationPage' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0103  The name 'Detail' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    20  Active
Error   CS0161  'MainPage.NavigateFromMenu(int)': not all code paths return a value MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    23  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    25  Active
Error   CS0518  Predefined type 'System.Enum' is not defined or imported    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    29  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    29  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    29  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    30  Active
Error   CS0246  The type or namespace name 'NavigationPage' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    30  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    30  Active
Error   CS0518  Predefined type 'System.Enum' is not defined or imported    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    32  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    32  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    32  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    33  Active
Error   CS0246  The type or namespace name 'NavigationPage' could not be found (are you missing a using directive or an assembly reference?)    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    33  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    33  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    40  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    40  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    40  Active
Error   CS0103  The name 'Detail' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    40  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    40  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    42  Active
Error   CS0103  The name 'Detail' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    42  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    44  Active
Error   CS0103  The name 'Device' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    44  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    44  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    44  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    44  Active
Error   CS0103  The name 'Device' does not exist in the current context MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    44  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    45  Active
Error   CS0103  The name 'Task' does not exist in the current context   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    45  Active
Error   CS0518  Predefined type 'System.Int32' is not defined or imported   MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    45  Active
Error   CS0518  Predefined type 'System.Object' is not defined or imported  MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    47  Active
Error   CS0103  The name 'IsPresented' does not exist in the current context    MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    47  Active
Error   CS0518  Predefined type 'System.Boolean' is not defined or imported MyApp_X D:\SOURCECODE\MyApp_X\MyApp_X\MyApp_X\Views\MainPage.xaml.cs    47  Active
Error       The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly C:\Users\erot\.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.   MyApp_X.UWP         
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.   MyApp_X.Android     1   Active
Warning     The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly C:\Users\erot\.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.   MyApp_X.Android         
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.   MyApp_X.UWP     1   Active
Error   MSB4062 The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly C:\Users\erot\.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. MyApp_X C:\Users\erot\.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets 84  
Error   MSB4062 The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly C:\Users\erot\.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.   MyApp_X C:\Users\erot\.nuget\packages\xamarin.forms\3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets 36  

推荐答案

尝试安装.Net Framework 4.7.1

Try installing .Net Framework 4.7.1

https://github.com/xamarin/Xamarin.Forms/issues/2667

这篇关于建立范本专案时发生错误-行动应用程式(Xamarin Forms)-Visual Studio 2017的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆