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

Prevent TagHelper classes with __Generated__ in their name to be resolved from Simple Injector #750

dotnetjunkie opened this issue Sep 19, 2019 · 1 comment


Copy link

@dotnetjunkie dotnetjunkie commented Sep 19, 2019

ASP.NET Core generates TagHelper classes on the fly, but those classes do not live in the Microsoft namespace. By default, the AddTagHelperActivation method only assumes types whose namespace starts with Microsoft. to be framework-supplied tag helpers that need to be resolved from the built-in configuration system. Generated tag helpers, however, should be resolved for the same reasons from the built-in configuration system.

This basically means that the following predicate:

type => !type.GetTypeInfo().Namespace.StartsWith("Microsoft")

should be changed to the following:

type => !type.GetTypeInfo().Namespace.StartsWith("Microsoft")
    && !type.GetTypeInfo().Name.Contains("__Generated__")
@dotnetjunkie dotnetjunkie modified the milestones: Backlog, v4.8 Sep 20, 2019

This comment has been minimized.

Copy link
Collaborator Author

@dotnetjunkie dotnetjunkie commented Sep 20, 2019

bug-750 branch created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.