0

Is MSBuild being deprecated in favor of TFS/Azure DevOps Build pipelines? I have some custom build steps I need to add, such as obfuscating code and computing file hashes. I'm not sure if I should add them as a custom target in my MSBuild/csproj file or if they should be separate steps in a build pipeline. Has Microsoft provided any guidance about which one to use and/or are there common best practices used by the .NET community?

What are the pros/cons of doing custom build steps in MSBuild vs as a build pipeline step?

Dave A
  • 484
  • 3
  • 10

1 Answers1

1

No, it's not deprecated. Build pipelines are just glorified task runners. All those pipelines do is run your MSBuild script; they don't actually "build" anything in the same sense that MSBuild builds things.

That said, here are some scenarios where it makes sense to add additional build targets and conditions to an MSBuild file:

  1. It needs to happen during local development
  2. It needs to happen across multiple CI solutions (i.e. Jenkins, TeamCity, Azure DevOps)
  3. You foresee switching to a different CI solution in the future

That should make the pros of MSBuild pretty obvious. It's going to work anywhere you build your application, including on your local desktop, and it's going to be portable. It also has the advantage of being automatically tracked by version control, which (unless you're using YAML build), Azure DevOps builds are not.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120