Search Issue Tracker
By Design
By Design in 2023.3.X
Votes
0
Found in
2022.3.7f1
2023.1.8f1
2023.2.0b4
2023.3.0a2
Issue ID
UUM-46879
Regression
Yes
Exceptions are thrown in the Profiler (Standalone Process) window Console when IsValidFolder and CreateAssets are called
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
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
- [macOS] Editor crashes after entering Play mode with overlapping GameObjects with Cloth Component and Cloth Inter-Collision enabled
- Look Dev constantly regenerates the default Volume Profile when set to "None" instead of using the default one
- Look Dev errors are spammed when opening a new HDRP project when Look Dev was added to the layout in the previous project
- URP Scene Templates are not editable when first opened from the New Scene dialog
- Look Dev window flickers when resizing the window after docking it
Resolution Note:
Calling `IsValidFolder()` will return true even on the Standalone Profiler process.
The Profiler process is actually a stripped Unity Editor process, so to prevent calling CreateAsset off the main process and prevent the exception being thrown we need to try and detect if the current process is the main Editor, for example, by using (as suggested in the Editor script in the supplied issue) :
if (UnityEditor.MPE.ProcessService.level != UnityEditor.MPE.ProcessLevel.Secondary)
{
AssetDatabase.CreateAsset(settings, path);
AssetDatabase.SaveAssets();
}
Resolution Note (2023.3.X):
Calling `IsValidFolder()` will return true even on the Standalone Profiler process.
The Profiler process is actually a stripped Unity Editor process, so to prevent calling CreateAsset off the main process and prevent the exception being thrown we need to try and detect if the current process is the main Editor, for example, by using (as suggested in the Editor script in the supplied issue) :
if (UnityEditor.MPE.ProcessService.level != UnityEditor.MPE.ProcessLevel.Secondary)
{
AssetDatabase.CreateAsset(settings, path);
AssetDatabase.SaveAssets();
}