Search Issue Tracker
Won't Fix
Votes
0
Found in
2023.1.0a5
Issue ID
UUM-18336
Regression
Yes
Switching project branches with Unity open causes compilation to fail until restart with missing NUnit metafile
After [https://ono.unity3d.com/unity/unity/pull-request/145172/_/scripting/update-nunit-package-2.0.3] has been merged to trunk, switching branches in a specific project (with no major differences between branches, and which has always worked fine) causes an error related to a missing NUnit metafile, which will persist until Unity is closed.
How to reproduce:
1- Clone [https://github.cds.internal.unity3d.com/unity/com.unity.timeline]
2- Checkout the uitoolkit/feature/header-resize-manipulator branch
3- Open the Unity project at \.project
4- Checkout branch main. Wait for compilation to finish
5- This error should appear:
{code:java}
error CS0006: Metadata file 'Library/PackageCache/com.unity.ext.nunit@1.0.6/net40/unity-custom/nunit.framework.dll' could not be found{code}
6- Compilation will fail until Unity is restarted.
This is not reproducible with 2023.1.0a4 (or the revision before the NUnit PR merge)
Sent to this area after a discussion with [~jonathan] .
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- OnDemandRendering.willCurrentFrameRender returns incorrect values in the Player when UnityEngine.Rendering.OnDemandRendering.renderFrameInterval is greater than 1
- Root motion is not reapplied when transitioning from an animation without root motion to an animation with root motion
- Crash on Walk when opening a specific project
- [WebGL] Unclear error when GZIP compressed data or WebAssembly don't have correct HTTP headers
- Camera Preview shows view from last selected Base Camera for Overlay Cameras
Resolution Note:
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