0

I'm working to automate my build Devops Pipelines. My Visual Studio (15.9.7) build succeeds, but when I try the build in Devops Pipelines, I get the error:

    Error : NETSDK1061: The project was restored using
    Microsoft.NETCore.App version 1.0.0,
    but with current settings, version 2.1.0 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.

I've tried using a Microsoft build agent (VS2017) as well as using the machine where I have a successful build from Visual Studio. In both cases, I get the same error.

I've looked for references to Microsoft.NETCore.App using text searches across all the files and am not finding any references to 1.0.0.

As another data point, here's my output of dotnet --info: .NET Core SDK (reflecting any global.json): Version: 2.2.103 Commit: 8edbc2570a

    Runtime Environment:
    OS Name:     Windows
    OS Version:  10.0.17134
    OS Platform: Windows
    RID:         win10-x64
    Base Path:   C:\Program Files\dotnet\sdk\2.2.103\

    Host (useful for support):
      Version: 2.2.1
      Commit:  878dd11e62

    .NET Core SDKs installed:
      2.1.503 [C:\Program Files\dotnet\sdk]
      2.1.504 [C:\Program Files\dotnet\sdk]
      2.2.103 [C:\Program Files\dotnet\sdk]

    .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

    To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download
Rajesh
  • 179
  • 11
  • 1
    How did you define your build definition? Could you share a screenshot of your build definition? – Cece Dong - MSFT Feb 18 '19 at 09:30
  • Possible duplicate of [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](https://stackoverflow.com/questions/53720678/netsdk1061-the-project-was-restored-using-microsoft-netcore-app-version-1-0-0) – Lex Li Feb 18 '19 at 17:34

1 Answers1

0

The fix for my issue turned out to be in another question on StackOverflow that I missed in my original searches. The fix was to:

  • Set the RuntimeIdentifiers property to a semicolon-separated list of all the RIDs to be published.
  • Set the TargetLatestRuntimePatch property to true.
Rajesh
  • 179
  • 11