NETSDK1061:该项目是使用 Microsoft.NETCore.App 版本 1.0.0 恢复的,但使用当前设置,将使用版本 2.0.9 [英] 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

查看:16
本文介绍了NETSDK1061:该项目是使用 Microsoft.NETCore.App 版本 1.0.0 恢复的,但使用当前设置,将使用版本 2.0.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发移动应用程序并使用 MS App Center for CI.昨天,单元测试项目未能在 App Center 中构建,并出现以下错误.我无法在任何开发人员机器上重现该问题,此错误仅出现在 App Center 中.

I'm developing a mobile app and using MS App Center for CI. Yesterday the Unit Test project failed to build in App Center with the following error. I couldn't recreate the issue on any developer machine, this error only occours in 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 上遇到过这个问题吗?

Their paid support just give the basics, clean the project, roll back my last commit ect. Has anyone come into this issue before on App Center?

推荐答案

您需要设置相同的发布和构建运行时

You need to set the same publish and building runtimes

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion> --> fix publishing issues
    <PlatformTarget>AnyCPU</PlatformTarget> --> fix publishing issues
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Update="Microsoft.NETCore.App" Version="2.1.0" /> --> fix building issues
    <ProjectReference Include="..PublicSonar.Monitor.Persistent.JsonPublicSonar.Monitor.Persistent.Json.csproj" />
  </ItemGroup>
</Project>

这篇关于NETSDK1061:该项目是使用 Microsoft.NETCore.App 版本 1.0.0 恢复的,但使用当前设置,将使用版本 2.0.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆