How to reproduce:
1. Open the attached “StandaloneProfilerBugs.zip“ project
2. Open the Profiler (Window> Analysis> Profiler (Standalone Process))
Expected result: No errors in the Profiler Console
Actual result: “System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.“ and “CreateSerializedAsset is not supported while importing in a slave“ errors in the Profiler Console
Reproducible with: 2022.2.0a3, 2022.3.7f1, 2023.1.8f1, 2023.2.0b4, 2023.3.0a2
Not reproducible with: 2021.3.29f1, 2022.2.0a2
Reproducible on: macOS 13.4.1 (Intel), Windows 11 (User Reported)
Not reproducible on: No other environment tested
Notes:
- User reported that IsValidFolder returns true despite being in ProcessLevel.Secondary
- User reported that the exception shouldn't happen because the IsValidFolder call is happening right before CreateAssets. When not called from InitializeOnLoadMethod, no exceptions are thrown