Reproduction steps:
1. Open the “ReproProject“ project
2. Open the Preferences window (Edit > Preferences)
3. Set “Script Changes While Playing“ to “Recompile After Finished Playing“ in the General tab
4. Set “Auto Refresh” to “Enabled“ in the Asset Pipeline tab
5. Compile the scripts (ET > Compile)
6. Enter Play Mode
7. Open the “Assets/Scripts/HotfixView/Client/Demo/Opera/OperaComponentSystem“ script
8. Insert “Debug.Log(“123“);“ after line 19
9. Save the script
10. Repeat step 5
11. Exit Play Mode
12. Repeat step 7
13. Delete the “Debug.Log(“123“);“ line
14. Repeat step 9
15. Observe the Console window
Expected result: The scripts are recompiled and no errors are thrown in the Console window
Actual result: “InvalidCastException: Specified cast is not valid.“ error is thrown in the Console window
Reproducible with: 2022.2.0b16, 2022.3.19f1, 2023.2.8f1, 2023.3.0b5
Not reproducible with: 2021.3.34f1
Couldn’t test with: 2022.1.0a1, 2022.1.24f1, 2022.2.0a1, 2022.2.0b15 (due to RecompileAfterFinishedPlaying feature missing, compilation errors and [Internal link])
Reproducible on: Windows 11 Pro (22H2)
Not reproducible on: No other environment tested