Search Issue Tracker
By Design
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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();
}