首页 > 解决方案 > 如何修复 Azure 构建管道错误:元素中的属性“版本”无法识别

问题描述

我有一个 Azure 管道,它使用macOS-10.15构建代理为 Android 构建 Xamarin.Forms 应用程序。我最近开始收到错误消息:The nuget command failed with exit code(1) and error(/Users/runner/work/1/s/MyApp/MyApp.UWP/MyApp.UWP.csproj : error MSB4057: The target "_IsProjectRestoreSupported" does not exist in the project.执行NuGet Restore任务时。我从这里使用 bash 脚本解决了这个问题。(如果您有更好的修复建议,将不胜感激:)

现在我收到警告消息:>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

紧随其后的是错误消息:

Build FAILED.
Errors:

/Users/runner/work/1/s/MyApp/MyApp.Android/MyApp.Android.csproj: error : /Users/runner/work/1/s/MyApp/MyApp.Android/MyApp.Android.csproj: The attribute "Version" in element <PackageReference> is unrecognized.

关于如何解决此警告以及管道中的错误的任何想法?

注意:我目前使用专门用于 Android 的 Windows-2019 代理来运行它,但想为 iOS 和 Android 使用相同的 Build 代理(即 macOS 10.15)。

标签: c#xamarin.formsxamarin.androidmonoazure-pipelines

解决方案


推荐阅读