Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue where ForEachAssembly() didn't catch a TypeLoadException that can be thrown by GetCustomAttributes(). #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

binarynate
Copy link

Hi 👋🏻. I use ConditionalCompilationUtility in a library called 3D WebView, and a user contacted me about an issue where an uncaught TypeLoadException was being thrown by ConditionalCompilationUtility. Here's the stack trace they sent me:

TypeLoadException: Could not resolve type with token 01000008 from typeref (expected class 'System.Resources.NeutralResourcesLanguageAttribute' in assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) (at <75633565436c42f0a6426b33f0132ade>:0)
System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Boolean inherit) (at <75633565436c42f0a6426b33f0132ade>:0)
System.Reflection.RuntimeAssembly.GetCustomAttributes (System.Boolean inherit) (at <75633565436c42f0a6426b33f0132ade>:0)
Vuplex.WebView.ConditionalCompilation.ConditionalCompilationUtility+<>c__DisplayClass9_0.<UpdateDependencies>b__1 (System.Reflection.Assembly assembly) (at Assets/Vuplex/WebView/Core/Editor/Scripts/ConditionalCompilationUtility.cs:191)
Vuplex.WebView.ConditionalCompilation.ConditionalCompilationUtility.ForEachAssembly (System.Action`1[T] callback) (at Assets/Vuplex/WebView/Core/Editor/Scripts/ConditionalCompilationUtility.cs:252)
Vuplex.WebView.ConditionalCompilation.ConditionalCompilationUtility.UpdateDependencies (System.Boolean reset) (at Assets/Vuplex/WebView/Core/Editor/Scripts/ConditionalCompilationUtility.cs:189)

I updated the version of CCU that ships with 3D WebView to incorporate the change in this PR and the user confirmed that it resolved the issue for them. I'm just submitting this change in a PR now to help others avoid it in the future.

…on that can be thrown by GetCustomAttributes().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant