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
- Incorrect color values are saved for Swatches when using HDR Color Picker
- Editor crashes when adding/removing a UI Document Style Sheet while in Play mode
- Scene and Game views turn black when all light sources are disabled
- Memory spike after activating Freeform Light2Ds
- Line Renderer Component elements do not fit in the Inspector window when minimising Inspector window is minimised
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.