-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Allow open generics to be included in AllClasses scan #42
Comments
I've pushed v2.2.0 with support for open generic scanning to NuGet. |
Many thanks for the quick change! One little note... If one is including non-public classes in the scan, nested private classes will also be picked up. This isn't usually a problem, but it can be in some special cases. I ran into one of these after updating to v2.2.0, which was related to the nested classes generated by the compiler for The problem is trivial to avoid via use of the Thanks again! |
Hmm. Those should probably don't be included anyway. I think I should add a filter for classes with the
Yes, I was thinking about bumping this version to 3.0 because of the potential of breaking people with this change, but decided against it. Might be a nice middleground to add a note to the readme. |
Pushed v2.2.1 which excludes compiler-generated types from scanning 😄 |
Thanks! It's working perfectly. |
@khellang This issue seems to still be happening in .NET Core 3.0. I'm using the following code:
An internal class with an async method is then causing an Is this a new issue because perhaps Also, speaking of excluding unwanted types, you may be able to help also with this related question on SO. |
Hi @NeoXtreem! 👋 It could be an issue that the type doesn't have Could you open a new issue with a bit more information about the type? |
OK, I've raised issue #108. It appears it happens on C# closures. |
At present, open generics are excluded from an
<assembly>.AddClasses
scan (viaReflectionExtensions.IsNonAbstractClass
, which considers a concrete open generic to be abstract). The container supports registration of open generics, so it's a little puzzling why this limitation is in place. It would be lovely to be able to include open generic registration in a scan something like the following:The text was updated successfully, but these errors were encountered: