Quick tip Treating Warnings as Errors

Published 22 November 2023

Currently I am upgrading CMSImport to Umbraco V13. I could have been done by now if I didn't broke my old rule to treat Warnings as Errors.

The problem

Umbraco releases a major release every 6 months. And in a major release it is allowed to have breaking changes. Nice thing about Umbraco is that it will not simply remove the old code but marks the old code as obsolete first. In a next release they will remove the code and your code that uses the obsolete items will break. Until then it will generate a warning and because I ignored them last time it's quite a list now


Help your future self

By adding <TreatWarningsAsErrors>True</TreatWarningsAsErrors> to your .CSProj file your solution will log errors instead of warnings and you need to fix those warnings before you can continue. Doing this in an early stage will probably give you a small list of things to fix instead of the 60+ I now have to fix.

  <Authors>Soeteman Software</Authors>
  <Copyright>Soeteman Software</Copyright>