我正在尝试创建Xamarin.Forms Mac应用程序。我遵循了似乎有些过时的本指南,但我仍然可以遵循Visual Studio Mac 2017的步骤进行操作:
https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/
在遵循指南时,我会陷入以下困境:
LoadApplication(new App());
它说:
The name 'LoadApplication' does not exist in the current context
我试图清理所有内容,仅构建PCL项目,删除并重新添加对MacOS项目的引用,如另一个问题所述,但运气不好。
我想念什么?
还是取消了macOS支持?
在命令行上运行dotnet build
时,我得到:
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
/Users/jens/tests/desktop/FormsTest/FormsTest.Mac/FormsTest.Mac.csproj(108,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/2.1.302/Xamarin/Mac/Xamarin.Mac.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Build FAILED.
/Users/jens/tests/desktop/FormsTest/FormsTest.Mac/FormsTest.Mac.csproj(108,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/2.1.302/Xamarin/Mac/Xamarin.Mac.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.10
那么,如何安装此“ Xamarin.Mac.CSharp.targets”?