0
votes

I have a solution with 2 projects:

  • Client Library project made for .NET Standard 2.0
  • Test project for .NET Core 3.0

And I created Azure DevOps pipeline which builds and packs this library for DevOps private Nuget feed. The pipeline contains the following steps:

  1. Use NuGet >= 5.3.1 (added this hoping to solve the issue)
  2. Use .Net Core sdk 3.0.100 (added this hoping to solve the issue)
  3. Restore packages
  4. Build ...

But the process fails at Restore packages step with:

error NU1201: Project [Test Project] is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Project [Test Project] supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0)

So how can I set up CI/CD for .Net Core 3.0?

I DO NOT use YAML - I hate that thing.

1
It's quite strange that this scenario should always works. I've done several tests but can't reproduce same issue :-( If possible, could you please share the two xx.csproj files and the details about your pipeline settings for better trouble-shooting ?LoLance
For the error message, it seems that you have a third project which targets .net core 2.2 or maybe your .net standard project targets both .net standard and .net core 2.2.... Also, I'm not sure which restore step do you use, dotnet restore or nuget restore? It could be much better if we can get the details :) BTW, i did the tests in host agent, if you're meeting this issue in self-agent, please feel free to let me know it! (Better with system.debug=true log!)LoLance
What task do you use to restore packages? If you are using a nuget task, try using the dotnet task and choose restore as commandPaulVrugt

1 Answers

0
votes

I tried "Use Nuget" to force the pipeline to use the latest Nuget. I also tried to for it using the latest .Net Core 3.1.x. All this doesn't help.

What helped was the re-creation of the test project. Now the pipeline works!