2

We have an on-premises Azure DevOps 2019 server, with build pipelines for numerous .Net 4.x solutions that our small team maintains using VS2019.

The team is about to upgrade to VS2022, and at some point I would like to migrate some solutions to .Net 6. Can DevOps 2019 build .Net 6 solutions, and if so what changes are needed to support this (such as presumably installing VS2022 on the server)?

Will those solutions' build pipelines require any changes or should they continue to work as-is? They don't contain anything too clever, with steps such as: NuGet restore, build solution, run unit tests, NuGet pack & push. (The build pipelines are managed via the web GUI, not YAML, if that makes a difference).

Some solutions will remain .Net 4.x, so the server will still need to support (build) these.

Andrew Stephens
  • 9,413
  • 6
  • 76
  • 152

1 Answers1

1

You should just need two things:

  1. First you have to install the corresponding SDK for building the apps (see sdk download - Build apps - SDK) on your build-agents.
  2. (Optional) Add or modify your set SDK Task in your pipelines (see use dotnet core task).

One more hint, you don't need to install a whole VS on the server. The Build-Tools are enough (VS2022 Buildtools preview).

Kraego
  • 2,978
  • 2
  • 22
  • 34
  • Thanks for this, although I'm not sure I understand what #2 is used for. Do I need *either* 1 or 2, or both? If I do need both, would I add the build task to my pipelines, and use it to specify the version of the SDK installed in #1? – Andrew Stephens Jun 28 '22 at 08:10
  • 1
    #2 is needed when you have several pipelines building with different SDKs, like in your case – Kraego Jun 28 '22 at 14:10
  • I guess I was expecting the build pipelines to detect which .Net version is being used by the solution being built, and the build step would "just work" regardless of whether it is Framework 4.x or .Net 6. It sounds like that's not the case, hence the need to add #2 to the .Net6 pipelines? – Andrew Stephens Jun 29 '22 at 08:27
  • 1
    It can work without step 2, but this step is or was in the ms pipeline template, plus imho. be explicit when you can, thats why I use this task, it is not mandatory, i f someone change the version in the solution into one not installed on the buildagents the pipeline will probably fail anyway – Kraego Jun 29 '22 at 08:57
  • Another question sorry. My existing .Net 4.x build pipeline builds the solution using a "Visual Studio Build" task. The highest version listed in the "Visual Studio version" combobox is 2019, so I'm assuming this task won't work (unless I install VS2022 on our ADO server)? Should I therefore replace this task with the "MSBuild" task? In this one, the highest version listed in the "MSBuild version" combobox, is 16.0. Is that correct? I installed the .Net 6.0.301 "build apps" SDK on our Azure DevOps server yesterday. – Andrew Stephens Jun 30 '22 at 10:14
  • I think you have to update your azure devops instance if you want to use the vs task, maybe this workaround could help you: https://stackoverflow.com/a/70876611/11473934 . Or try the msbuild task – Kraego Jun 30 '22 at 10:46