risk-of-thunder / RoR2BepInExPack

RoR2BepInExPack
MIT License
1 stars 10 forks source link

Readd try catch inside foreach for SearchableAttribute ScanAssembly #33

Closed xiaoxiao921 closed 2 months ago

xiaoxiao921 commented 2 months ago

https://github.com/risk-of-thunder/RoR2BepInExPack/blob/dlc1/RoR2BepInExPack/VanillaFixes/SaferSearchableAttribute.cs

because of things such as

[Info   :   Console] ScanAllAssemblies failed for 'SonicTheHedgehog, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null':  System.IO.FileNotFoundException: Could not load file or assembly 'CustomEmotesAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'CustomEmotesAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info(intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) [0x00000] in <7e05db41a20b45108859fa03b97088d4>:IL_0000 
  at System.Reflection.RuntimeMethodInfo.GetPseudoCustomAttributes () [0x00002] in <7e05db41a20b45108859fa03b97088d4>:IL_0002 
  at System.MonoCustomAttrs.GetPseudoCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType) [0x0000c] in <7e05db41a20b45108859fa03b97088d4>:IL_000C 
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00021] in <7e05db41a20b45108859fa03b97088d4>:IL_0021 
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00037] in <7e05db41a20b45108859fa03b97088d4>:IL_0037 
  at System.Reflection.RuntimeMethodInfo.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in <7e05db41a20b45108859fa03b97088d4>:IL_0000 
  at System.Attribute.GetCustomAttributes (System.Reflection.MemberInfo element, System.Type type, System.Boolean inherit) [0x00088] in <7e05db41a20b45108859fa03b97088d4>:IL_0088 
  at System.Reflection.CustomAttributeExtensions.GetCustomAttributes (System.Reflection.MemberInfo element, System.Type attributeType, System.Boolean inherit) [0x00000] in <7e05db41a20b45108859fa03b97088d4>:IL_0000 
  at System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T] (System.Reflection.MemberInfo element, System.Boolean inherit) [0x00000] in <7e05db41a20b45108859fa03b97088d4>:IL_0000 
  at HG.Reflection.SearchableAttribute.ScanAssembly (System.Reflection.Assembly assembly) [0x000cc] in <44b84d9ef48f44a6bfd5d3747ef217f7>:IL_00CC 
  at HG.Reflection.SearchableAttribute.ScanAllAssemblies () [0x0001d] in <44b84d9ef48f44a6bfd5d3747ef217f7>:IL_001D