构建模板项目时出错-移动应用程序(Xamarin Forms)-Visual Studio 2017

时间:2018-09-04 21:21:20

标签: visual-studio xamarin.forms visual-studio-2017

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

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

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  

1 个答案:

答案 0 :(得分:0)

尝试安装.Net Framework 4.7.1

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

相关问题