Search Issue Tracker
Fixed
Fixed in 1.7.8
Votes
0
Found in [Package]
1.7.3
Issue ID
UVSB-1900
Regression
No
Code Analysis package throws "Failed to load types" warnings when entering Play Mode
*Reproducible on:*
* VS version: 1.7.5, 1.4.15
* Unity version: 2021.2.0f1
* Platforms: Windows 10 and macOS Big Sur.
*How to reproduce:*
1. Create a new project
2. Open Package Manager (Window -> Package Manager) Update to VS 1.7.5 if its not that version by default
3. Press on the plus sign and select "Add package from git URL..."
4. Enter "com.unity.code-analysis" and press "Add"
5. Create a new game Object attach to it a Script machine
6. Create a new acript graph
*Actual result:*
* Warnings are thrown in the console
{code:java}
Failed to load types in assembly 'Microsoft.CodeAnalysis.Scripting, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
Could not load type of field 'Microsoft.CodeAnalysis.Scripting.Hosting.CoreAssemblyLoaderImpl:_inMemoryAssemblyContext' (0) due to: Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <7b5f9a2f7db343a4ab54846ed680277b>:0
at Unity.VisualScripting.TypeUtility+<GetTypesSafely>d__35.MoveNext () [0x00017] in C:\Users\wendy.valles\Downloads\Code Analisys3\Library\PackageCache\com.unity.visualscripting@1.7.5\Runtime\VisualScripting.Core\Reflection\TypeUtility.cs:802
System.TypeLoadException: Could not load type of field 'Microsoft.CodeAnalysis.Scripting.Hosting.CoreAssemblyLoaderImpl:_inMemoryAssemblyContext' (0) due to: Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
System.TypeLoadException: Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
UnityEngine.Debug:LogWarning (object)
Unity.VisualScripting.TypeUtility/<GetTypesSafely>d__35:MoveNext () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Reflection/TypeUtility.cs:806)
Unity.VisualScripting.Codebase:.cctor () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Reflection/Codebase.cs:78)
Unity.VisualScripting.SingleDecoratorProvider`3<Unity.VisualScripting.Metadata, Unity.VisualScripting.Inspector, Unity.VisualScripting.EditorAttribute>:get_typeset () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Decorators/SingleDecoratorProvider.cs:49)
Unity.VisualScripting.SingleDecoratorProvider`3<Unity.VisualScripting.Metadata, Unity.VisualScripting.Inspector, Unity.VisualScripting.EditorAttribute>:MapAttributeTypes () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Decorators/SingleDecoratorProvider.cs:57)
Unity.VisualScripting.SingleDecoratorProvider`3<Unity.VisualScripting.Metadata, Unity.VisualScripting.Inspector, Unity.VisualScripting.EditorAttribute>:.ctor () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Decorators/SingleDecoratorProvider.cs:23)
Unity.VisualScripting.EditorProvider:.ctor ()
Unity.VisualScripting.EditorProvider:.cctor () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/EditorProvider.cs:38)
Unity.VisualScripting.XEditorProvider:Editor (Unity.VisualScripting.Metadata) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/EditorProvider.cs:49)
Unity.VisualScripting.LudiqRootObjectEditor/Individual:OnGUI () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/Root/LudiqRootObjectEditor.cs:45)
Unity.VisualScripting.OptimizedEditor`1<Unity.VisualScripting.LudiqRootObjectEditor/Individual>:OnInspectorGUI () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/OptimizedEditor.cs:31)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Failed to load types in assembly 'Microsoft.CodeAnalysis.Scripting, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
Could not load type of field 'Microsoft.CodeAnalysis.Scripting.Hosting.CoreAssemblyLoaderImpl:_inMemoryAssemblyContext' (0) due to: Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <7b5f9a2f7db343a4ab54846ed680277b>:0
at Unity.VisualScripting.TypeUtility+<GetTypesSafely>d__35.MoveNext () [0x00017] in C:\Users\wendy.valles\Downloads\Code Analisys3\Library\PackageCache\com.unity.visualscripting@1.7.5\Runtime\VisualScripting.Core\Reflection\TypeUtility.cs:802
System.TypeLoadException: Could not load type of field 'Microsoft.CodeAnalysis.Scripting.Hosting.CoreAssemblyLoaderImpl:_inMemoryAssemblyContext' (0) due to: Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
System.TypeLoadException: Could not resolve type with token 0100006a from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
UnityEngine.Debug:LogWarning (object)
Unity.VisualScripting.TypeUtility/<GetTypesSafely>d__35:MoveNext () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Reflection/TypeUtility.cs:806)
Unity.VisualScripting.RuntimeCodebase:.cctor () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Reflection/RuntimeCodebase.cs:65)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_2_Inheritance (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:583)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_1_ProcessCycles (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:506)
Unity.VisualScripting.FullSerializer.fsSerializer:TrySerialize (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:451)
Unity.VisualScripting.FullSerializer.fsSerializer:TrySerialize (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:407)
Unity.VisualScripting.FullSerializer.fsIEnumerableConverter:TrySerialize (object,Unity.VisualScripting.FullSerializer.fsData&,System.Type) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/Converters/fsIEnumerableConverter.cs:45)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_4_Converter (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:627)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_3_ProcessVersioning (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:621)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_2_Inheritance (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:529)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_1_ProcessCycles (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:506)
Unity.VisualScripting.FullSerializer.fsSerializer:TrySerialize (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:451)
Unity.VisualScripting.FullSerializer.fsReflectedConverter:TrySerialize (object,Unity.VisualScripting.FullSerializer.fsData&,System.Type) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/Converters/fsReflectedConverter.cs:43)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_4_Converter (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:627)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_3_ProcessVersioning (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:606)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_2_Inheritance (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:529)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_1_ProcessCycles (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:506)
Unity.VisualScripting.FullSerializer.fsSerializer:TrySerialize (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:451)
Unity.VisualScripting.FullSerializer.fsReflectedConverter:TrySerialize (object,Unity.VisualScripting.FullSerializer.fsData&,System.Type) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/Converters/fsReflectedConverter.cs:43)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_4_Converter (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:627)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_3_ProcessVersioning (System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:621)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_2_Inheritance (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:529)
Unity.VisualScripting.FullSerializer.fsSerializer:InternalSerialize_1_ProcessCycles (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:506)
Unity.VisualScripting.FullSerializer.fsSerializer:TrySerialize (System.Type,System.Type,object,Unity.VisualScripting.FullSerializer.fsData&) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Dependencies/FullSerializer/fsSerializer.cs:451)
Unity.VisualScripting.Serialization:SerializeJson (Unity.VisualScripting.FullSerializer.fsSerializer,object,bool) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Serialization/Serialization.cs:161)
Unity.VisualScripting.Serialization:Serialize (object,bool) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Serialization/Serialization.cs:83)
Unity.VisualScripting.LudiqScriptableObject:UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Runtime/VisualScripting.Core/Unity/LudiqScriptableObject.cs:26)
Unity.VisualScripting.GraphNestEditor:OnNewMacroButtonGUI (UnityEngine.Rect) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/GraphNestEditor.cs:454)
Unity.VisualScripting.GraphNestEditor:OnGUI (UnityEngine.Rect,UnityEngine.GUIContent) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/GraphNestEditor.cs:215)
Unity.VisualScripting.Inspector:Draw (UnityEngine.Rect,UnityEngine.GUIContent) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/Inspector.cs:134)
Unity.VisualScripting.LudiqGUI:Editor (Unity.VisualScripting.Metadata,UnityEngine.Rect) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Interface/LudiqGUI.cs:102)
Unity.VisualScripting.MachineEditor:OnNestGUI (UnityEngine.Rect) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/MachineEditor.cs:81)
Unity.VisualScripting.MachineEditor:OnGUI (UnityEngine.Rect,UnityEngine.GUIContent) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/MachineEditor.cs:54)
Unity.VisualScripting.Inspector:Draw (UnityEngine.Rect,UnityEngine.GUIContent) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/Inspector.cs:134)
Unity.VisualScripting.Inspector:DrawLayout (UnityEngine.GUIContent,single,UnityEngine.RectOffset) (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/Inspector.cs:322)
Unity.VisualScripting.LudiqRootObjectEditor/Individual:OnGUI () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/Root/LudiqRootObjectEditor.cs:52)
Unity.VisualScripting.OptimizedEditor`1<Unity.VisualScripting.LudiqRootObjectEditor/Individual>:OnInspectorGUI () (at Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Inspection/OptimizedEditor.cs:31)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
{code}
*Expected result:*
* No warnings in the console
Note:
- Any version of Code Analysis package can be used to reproduce the issue
- The same warnings are thrown when entering Play Mode
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Created asset is placed in a new folder when creating a new folder and instantly creating an asset by clicking somewhere else
- Selecting and deleting transition in Animator does not add to Undo History when animation is previewed in Inspector
- GameObjects remain static when updating constraints of PhysicsJoint with "Enable Sleeping" selected in Havok Physics Configuration
- [iOS] Touch input is not clocked and UI is unresponsive when the application is paused mid-drag without lifting the finger
- [sw-unity-6-1] Scene view renders any light differently when more than one camera exists and neither have the "MainCamera" tag
Add comment