【发布时间】:2019-05-12 05:44:26
【问题描述】:
我正在开发一个移动应用程序并使用 MS App Center for CI。昨天单元测试项目未能在 App Center 中构建,出现以下错误。我无法在任何开发人员机器上重现该问题,此错误仅在 App Center 中出现。
error : NETSDK1061: The project was restored using Microsoft.NETCore.App version 1.0.0, but with current settings, version 2.0.9 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.
他们的付费支持只是提供基础知识、清理项目、回滚我的最后一次提交等。以前有人在 App Center 上遇到过这个问题吗?
【问题讨论】:
-
避免此问题的最简单方法是使用您要发布的相同配置进行构建,然后运行 dotnet publish --no-restore -r win10-x64 或您希望发布到的任何运行时
-
我无法控制 App Center 使用的命令,它是基于 SaaS 的 CI。
-
你可能不得不向当时有控制权的人提出这个问题
-
如果这是唯一的解决方法,那么很可能是他们的平台有问题。有没有办法控制 csproj 或 sln 文件中的配置?
标签: c# .net xamarin visual-studio-app-center