How to reproduce:
1. Create a new Unity project
2. Upgrade it to a newer Unity version
Expected result: project upgrades and opens successfully
Actual result: project fails to upgrade and errors are shown
Reproducible: 2021.2.7f1, 2021.2.19f1, 2021.3.4f1, 2022.1.5f1, 2022.2.0a17
Notes:
1. Reproduction of the issue is very rare, thus affected versions may not be entirely correct.
2. A temporary workaround is to download dotnet binaries, extract them and copy the '\packs' folder into 'Data\NetCoreRunTime' inside the Unity Editor installation directory.