c# - 如何修复 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)。
解决方案
推荐阅读
- sql - SQL Server 导出在 DateTime2 => PostgreSQL 上失败
- fosuserbundle - Symfony 4 FOSUser - 使 Google/Facebook 注册的密码可以为空
- c# - 如何使用 C# 复制刚刚上传到服务器的文件?
- bixby - 如何添加指向网站的链接?
- list - Tcl:如何在 Tcl 8.4 中搜索嵌套列表?
- c# - 使用数组设置/获取类的字段:比反射更快的方法?
- ruby-on-rails - 为什么不能直接更新 Active Record 查找的结果?
- angular-material - 检查其他任何一个时如何禁用复选框角度7
- ios - 如何在后台全局队列中运行一堆任务
- python - 无法分配主机名:在 django 中出现 getaddrinfo 错误