Unity Issue Tracker - Switching project branches with Unity open causes compilation to fail until restart with missing NUnit metafile
Closed
UUM-18336
Switching project branches with Unity open causes compilation to fail until restart with missing NUnit metafile
Unity: Scripting
Won't Fix
2023.1.X
The project in both branches of timeline is of an older Unity version (22.1). This means it needs to undergo upgrade when being opened and thus the use case of replacing the already upgraded project from the branch with a project for older unity version, while it is open in unity is not a meaningful operation and is not generally supported.
More concretely what happens here is that the branch names nunit 2.0.3 as a package dependency and it gets nunit 2.0.3 in the package cache. The main branch names nunit 1.0.6 as a dependency. When opened and upgraded this dependency is replaced by nunit 2.0.3 in the manifest and it gets that in the package cache. So both branches are supposed to use 2.0.3 when opened in Unity 2023.1. When the branch project is opened and then replaced by the main one by checking out main, the manifest is replaced and points back to nunit 1.0.6. which uses net35 instead of net40. This is not supported in 2023.1 and the project fails to compile as it hasn't undergone the upgrade as it was already open in unity when it ge