I sorted this out, so I thought I would just leave my solution here if anyone has the same problem in the future.
In the windows-latest to windows-2022 upgrade thread, someone posted a link to the Windows 10 SDK versions supported by windows-2022. I was targeting Windows 10, version 1903 which requires Windows 10 SDK 10.0.18362.0, this version of the SDK does not ship with the windows-2022 image. The SDKs that ships with windows-2022 are:
10.0.17763.0
10.0.19041.0
10.0.20348.0
10.0.22000.0
I changed the target Windows version of my app to Windows 10, version 2004 (the SDK is in windows-2022) and it built fine. My min version is Windows 10, version 1809 (the SDK is also in windows-2022) as this is the latest version of Windows 10, Windows 10 IoT Core ships with.
Alexander Schmidt has a nice (but little outdated) article explaining the windows SDKs the different Azure DevOps agents ship with.