For anyone here because their YAML build is failing - msbuild is x86 by default but you can specify x64 with this:
- name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 with: msbuild-architecture: x64