#FileNotFoundException with JetBrains.Annotations when using Essential Kit 3.4.2 in Unity 2022.3.62f

1 messages · Page 1 of 1 (latest)

blissful peak
#

When launching the app in the Unity Editor, I get:

#

FileNotFoundException: Could not load file or assembly
'JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral,
PublicKeyToken=1010a0d8d6380325'

#

Stacktrace points into Essential Kit’s TypeCache doing reflection.

The problem comes from the Rider Unity Editor Plugin:

#

~/Rider/plugins/rider-unity/EditorPlugin/JetBrains.Rider.Unity.Editor.Plugin.Net46.Repacked.dll
Type: JetBrains.Rider.PathLocator.RiderPathLocator+ToolboxState

wild sentinel
#

We use TypeCache for Domain Reload handling - for safe cleanup.

blissful peak
#

That DLL references a fake JetBrains.Annotations (4242.42.42.42).
Unity can’t resolve it → reflection explodes.

Impact:

Essential Kit 3.4.2 editor code (e.g. DomainReloadManager) crashes on domain reload.

Adding a separate JetBrains.Annotations.dll doesn’t help (conflicts with UnityEngine.CoreModule).

Current workarounds:
Skip Rider assemblies during reflection

wild sentinel
#

Do you have complete log trace?

blissful peak
#

FileNotFoundException: Could not load file or assembly 'JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies.
System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) (at <9c9d7808da6a43e3b68409f2b63b3e6f>:0)
System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) (at <9c9d7808da6a43e3b68409f2b63b3e6f>:0)
System.Reflection.RuntimeMethodInfo.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) (at <9c9d7808da6a43e3b68409f2b63b3e6f>:0)
VoxelBusters.CoreLibrary.Editor.TypeCache.<GetMembersWithAttribute>g__AddMembersWithRequiredAttributes|9_0[TMemberInfo,TAttribute] (System.Type type, VoxelBusters.CoreLibrary.Editor.TypeCache+<>c__DisplayClass9_0`2[TMemberInfo,TAttribute]& ) (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs:106)
VoxelBusters.CoreLibrary.Editor.TypeCache.GetMembersWithAttribute[TMemberInfo,TAttribute] (System.Reflection.MemberTypes memberTypes, System.Reflection.BindingFlags bindingAttr) (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs:91)
VoxelBusters.CoreLibrary.Editor.TypeCache.GetMethodsWithAttribute[TAttribute] (System.Reflection.BindingFlags bindingAttr) (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs:53)
VoxelBusters.CoreLibrary.Editor.DomainReloadManager.SendReloadMessageToMethods () (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs:56)
VoxelBusters.CoreLibrary.Editor.DomainReloadManager.OnRuntimeLoad () (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs:26)

wild sentinel
#

I will also check once on my end as I expect only VoxelBusters namespace classes to be considered.

blissful peak
#

In my project, the attribute is checked for 44458 types, as all assemblies are scanned)

#

It seems to me that it is more correct to scan only assemblies from Voxel Busters.

wild sentinel
#

Yea, I will check it. I expect the same. My partner wrote it and I recall fixing some issues in it sometime back. Need to see why other than VB's classes + System are considered.

brisk steppe
#

we have the same issue:

FileNotFoundException: Could not load file or assembly 'JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies.
System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) (at <cac1dea318b4499fb9eaf77618617c23>:0)
System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) (at <cac1dea318b4499fb9eaf77618617c23>:0)
System.Reflection.RuntimeMethodInfo.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) (at <cac1dea318b4499fb9eaf77618617c23>:0)
VoxelBusters.CoreLibrary.Editor.TypeCache.<GetMembersWithAttribute>g__AddMembersWithRequiredAttributes|9_0[TMemberInfo,TAttribute] (System.Type type, VoxelBusters.CoreLibrary.Editor.TypeCache+<>c__DisplayClass9_0`2[TMemberInfo,TAttribute]& ) (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs:106)
VoxelBusters.CoreLibrary.Editor.TypeCache.GetMembersWithAttribute[TMemberInfo,TAttribute] (System.Reflection.MemberTypes memberTypes, System.Reflection.BindingFlags bindingAttr) (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs:91)
VoxelBusters.CoreLibrary.Editor.TypeCache.GetMethodsWithAttribute[TAttribute] (System.Reflection.BindingFlags bindingAttr) (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs:53)
VoxelBusters.CoreLibrary.Editor.DomainReloadManager.SendReloadMessageToMethods () (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs:56)
VoxelBusters.CoreLibrary.Editor.DomainReloadManager.OnRuntimeLoad () (at Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs:26)
#

Environment: Macos(lastest)
Unity Version: Unity 202.3.62f1
Build Platform: Android
Voxel Buster Version: Lastest

slender wigeon
#

The same error has occurred.

Environment

  • OS: Mac OS
  • Unity: 6000.0.56f1
  • Essential Kit: v3.5.0

Steps to Reproduce

  • Create a new Unity 6000.0.56f1 project.
  • Install Essential Kit v3.5.0.
  • Play the Sample Scene.

Stack Trace

wild sentinel
#

We are on it. We will provide a proper fix in coming version.

slender wigeon