gpt4 book ai didi

带有 Prism 的 Xamarin.Forms 未在 Visual Studio 2017 15.7.2 中构建

转载 作者:行者123 更新时间:2023-12-04 06:04:57 26 4
gpt4 key购买 nike

我有一个带有 Prism MVVM 的 Xamarin.Forms,在 Visual Studio 2017 15.7.2 中有构建问题。

此项目是在 Visual Studio 2017 15.6.2 中使用 Prism 模板创建的,并且运行良好。

我决定将我的 IDE 从 15.6.2 更新到 15.7.2,我的项目停止工作,出现以下错误:

Severity    Code    Description Project File    Line    Suppression State
Error Your project is not referencing the "MonoAndroid,Version=v8.1" framework. Add a reference to "MonoAndroid,Version=v8.1" in the "frameworks" section of your project.json, and then re-run NuGet restore. AppPrivateCard.Android

A Xamarin.Forms project do not have project.json file, as suggested by the error message, and I already modified the target Android version to Android 27 version (Android Oreo 8.1), but the error persists.

我已经将 Xamarin.Forms 更新到 3.0.0.482510 但什么也没有。

但是,如果我使用 VS 2017 15.7.2 创建一个没有 Prism 的 Xamarin 项目,并更新所有引用,则构建时不会出现此错误。所以,我认为问题出在 Prism 模板上。

我的一个选择是降级 VS 2017,但我宁愿不降级。

最佳答案

我也遇到了同样的问题。

原因:当我的项目目标是 android 版本 8.1 时,文件 obj/project.assets.json 目标是“MonoAndroid,Version=v7.1”

我通过以下方式解决了它:

  1. 右键单击 Android 项目 => 属性 => 应用程序 => 编译使用 Android 版本 => Android 7.1
  2. Clean and Build project => 构建成功,重启IDE。
  3. 右键单击 Android 项目 => 属性 => 应用程序 => 编译使用 Android 版本 => Android 8.1
  4. 清理并构建项目 => 构建成功

文件 obj/project.assets.json 更新为“MonoAndroid,Version=v8.1”

关于带有 Prism 的 Xamarin.Forms 未在 Visual Studio 2017 15.7.2 中构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50553196/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com