-
-
Notifications
You must be signed in to change notification settings - Fork 837
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
Collection Expressions-y Injections #1408
Comments
Is this the same as #1372? |
This would eliminate the need for it as this would be a general solution to that specific case. |
Then I'll close the other as duplicate. No need to address the same request twice. |
Can you provide a specific list of types you think qualify here? "Just know about all the types" isn't specific or feasible. Put another way, if we were to write unit tests to make sure this is "done," what would we test to verify it's done and we can close the issue? Also, FYI, "Autofac" - no cap F 😉 |
Hi, It seems a recent change in the 8.0.300 SDK made this more urgent. We are unable to run our application with the latest SDK as it's using a new type called This is the kind of errors we are getting now:
Could you please look into it? |
@MaQy, can you please raise a new issue for reporting this issue rather than adding to a feature request? Please ensure you include a minimal reproducible code example that causes the failure on 8.0.300. A public repo with an example is ideal. |
Hi again, It took me a while to pinpoint the issue as I was not able to reproduce it in an isolated way. The problem was actually partially in our code, though I think Microsoft is also to be blamed for the sudden change they did. As mentioned above, it seems they have introduced new collections for collection expressions:
This now gets compiled into an auto-generated collection that is inserted into the assembly where that code is located. The name of the class is I'm sorry for the off-topic and the false alarm, but I wanted to leave this somewhere as a word of warning in case anyone else encounters this issue. |
@MaQy what was the solution for the issue with |
I just put a filter to exclude
I already had the |
You should post in the appropriate forum about the compiler generated types. That sounds like a bug. |
@TonyValenti it seems this has already been reported by @ArnaudB88: dotnet/runtime#104372 (comment) |
bug resolved: |
Given this has been pending input for about six months I'm going to close the issue. The request, as a concept, has merit, but the title ("Collection Expressions-y Injections") and the somewhat ambiguous description (basically "inject this basic kind of thing" without an actual described universe of things - we can't "just know" about every collection type, we need to have a set of types or interfaces folks desire) leaves this in a place where no action can be taken. I think if this is a feature folks want, we'll need some fairly specific info on the actual need so we can, at the very least, determine when we're "done" implementing it, or maybe whether it's not possible. |
Problem Statement
AutoFac cannot create immutable or frozen collections.
Desired Solution
AutoFac should use rules/processes similar to what is outlined in collection expressions to create collections of the specified types.
Alternatives You've Considered
Additional Context
The text was updated successfully, but these errors were encountered: