Search Issue Tracker
By Design
Votes
0
Found in
2019.1.14f1
2020.1
Issue ID
1187183
Regression
No
Assembly.Load fails to load type of script in custom namespace when name is retrieved via Preset.GetTargetFullTypeName
To reproduce:
1. Open attached project
2. Open presets browser window via Window -> Pump Editor -> Presets Browser
3. Toggle on "Filter by preset type"
4. Select `MyNamespace.Test.MyComponent` as preset type.
5. Check Console
Actual results: Observe "FileNotFoundException: Could not load file or assembly 'MyNamespace' or one of its dependencies" exception in the console.
Expected results: There should be no errors
Reproduced in: 2019.2.15f1; 2020.1.0a12; 2021.2.0a10
Can not reproduce on 2017.4 and 2018.4 due to missing presets browser and errors
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
- Inspector elements are rendered twice when the script component is added via drag-and-drop while the HideFlags.HideInInspector property is set
- Error "Light baking failed with error code 5 (Convergence data not available while rendering lightmaps)" thrown in Console when generating lighting for specific GameObjects
- Copy and Paste options for an Animation Property value are disabled in the Right click contextual menu
- Asset is not found when searching the Label "NewLabel" in Search Window
- "Compute dispatch: missing texture ID..." and "Compute dispatch: missing UAV ID..." warnings are thrown after changing the platform in High Definition 3D template
Resolution Note (2021.2.X):
TypeUtility tries to load an assembly named MyNamespace without try/catch. If there is no assembly with that name (which is what happens here), this will throw an exception - that we see in the console.
This should be done within a try/catch block.
However, I suggest using the TypeCache to quickly access every types inheriting from UnityObject and quickly matching their FullTypeName.