Search Issue Tracker
Fixed
Fixed in 2022.2.5f1, 2023.1.0a23
Votes
32
Found in
2022.1.0a1
2022.1.17f1
2022.2.0b8
2023.1.0a10
Issue ID
UUM-14403
Regression
Yes
IL2CPP build fails due to UnityEditor.dll usage in user code
How to reproduce:
- Open attached project
 - In Build Settings window, Build for Windows IL2CPP
 - Once test completes, examine Console window
 
Expected result: No error
Actual result: "UnityEditor.dll assembly is referenced by user code, but this is not allowed."
Reproducible with: 2022.1.0a1, 2022.1.17f1, 2022.2.0b8, 2023.1.0a10
Not reproducible with: 2020.3.39f1, 2021.3.10f1
Reproduced on: Windows 10, Windows 11, Ubuntu 18.04
Note: This issue does not reproduce with Mono scripting backend
Comments (12)
- 
        
KethersHao
Nov 25, 2024 09:34
same on 2021.3.29f1
 - 
        
syedsaadwajid6168
May 29, 2024 10:37
same here in unity 2022.3.16
 - 
        
OneDudeDesign
Jan 23, 2024 16:24
Getting the same error in 2022.3.15f1
 - 
        
Michal_4D
Aug 22, 2023 16:29
Same problem with UNITY 2023.1.9f1.
It is not possible to publish even extremely simple project to WebGL because of that error. It is desperate situation!
 - 
        
jeremedia
Jan 29, 2023 06:50
The error occurs also on 2022.2.4f1
 - 
        
nol1fe
Jan 24, 2023 06:24
The error occurs also on 2022.2.3f1
 - 
        
joschaB
Jan 20, 2023 15:47
Same here on 2022.2.1f1
 - 
        
plotlessplot
Jan 20, 2023 15:02
Same issue building for iOS on macOS 13.1 and Unity 2022.2.2f1.
 - 
        
manurocker95
Jan 19, 2023 10:32
Same here on 2022.2.f1....
 - 
        
nol1fe
Jan 16, 2023 17:03
Same here on 2022.2.1f1
UnityEditor.dll assembly is referenced by user code, but this is not allowed.
UnityEditor.GenericMenu:CatchMenu (object,string[],int) 
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
- Video does not play in macOS build when built app is placed in a path with a space in it on a specific project
 - Crash on AuxWindowManager::OnGotFocus when trying to maximize a tab while Visual Effect Graph window is open
 - “NullReferenceException: Object reference not set to an instance of an object” error is thrown when
 - [Metal] Game freezes after command buffer Timeout error
 - Addressables Report window UI is broken when opening via Build > New Build > Default Build Script
 
Resolution Note (fix version 2023.1.0a23):
Fixed in: 2023.1.0a23
Resolution Note (fix version 2022.2.5f1):
Fixed in 2022.2.5f1