Search Issue Tracker
By Design
Votes
0
Found in
2020.2.0a12
2020.2.0b7
2021.1
Issue ID
1286237
Regression
Yes
Exceptions during compile for ILPostProcessors with static constructors
How to reproduce:
1. Open the attached project ("New Unity Project.zip")
2. Observe compile errors
Expected results: No compile errors
Actual results: System.MissingMethodException is thrown
Reproducible with: 2020.2.0a12, 2020.2.0b9, 2021.1.0a3
Not reproducible with: 2018.4.28f1, 2019.4.13f1, 2020.1.10f1, 2020.2.0a11
Note: Cause of error in PostProcessor.cs
Error:
(0,0): error System.MissingMethodException: Attempted to access a missing method.
Error with "EditorUtility.DisplayDialog("test", "test", "ok");" uncommented:
(0,0): error System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Test.CodeGen.PostProcessor' threw an exception. ---> System.MissingMethodException: Attempted to access a missing method.
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
- [Linux] Screen.SetResolution immediately applies windowed resolution when switching from Fullscreen to Windowed mode
- Lighting window allows non-cube map texture for Environment Reflections, throwing invalid texture type (2D) error
- Console warning “MismatchingRepositoryProjectMessage” when creating a new Unity Version Control workspace
- [Ubuntu] VFX Graph Enum Value menu stretches across screen when entered long Enum Value
- Unclear warning message in Rendering Debugger about the Play mode Debugger Overlay
Resolution Note:
You cannot call Unity APIs from ILPostProcessors, as they run outside of the Unity Editor process in 2020.2+ and inside a pure .NET application named ILPostProcessorRunner.
You can use Console.WriteLine instead of Debug.Log to get text output redirected to the console/editor log.