首页 > 解决方案 > 将 Xamarin 表单应用程序更新到最新版本会停止编译

问题描述

我受够了 Visual Studio 2017 Xamarin 工具的后牙。

我让我的应用程序在 UWP 和 Android 中以调试模式编译和运行,适用于 Android 8.0。但是,当我在 Android 上以 Release 模式运行它时,当我尝试从相机拍摄照片时,应用程序崩溃了。

我正在使用 Plugin.Media.Abstractions 来控制相机。我阅读了他们的文档,它说我必须CrossCurrentActivity.Current.Init(this, bundle);在使用包之前调用,但没有这样的方法。

所以我查看了包管理器,有很多更新(包括插件)。所以我更新了。

然后悲伤开始了。我无法更新,因为我的目标是奥利奥 8.0。所以我更新了 Visual Studio(下载了很多 GB),重新启动,将目标更改为 8.1,并更新了所有内容。

现在我什么都编译不了!我得到的第一个错误是:

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets.

所有引用在解决方案资源管理器中都有一个警告三角形。

我已经关闭了 VS,删除了 .vs 文件夹、obj 和 bin 文件夹,然后重新打开了它——没有任何变化。

我究竟做错了什么?

标签: xamarinbuildcompiler-errorsvisual-studio-2017

解决方案


推荐阅读