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

No support for .Net 6 #40

Open
gjhommersom opened this issue Oct 25, 2022 · 0 comments · May be fixed by #42
Open

No support for .Net 6 #40

gjhommersom opened this issue Oct 25, 2022 · 0 comments · May be fixed by #42

Comments

@gjhommersom
Copy link

I'm using this library for some test projects. This works fine as long as the target framework is .Net 5 or lower. Setting it to .Net 6 will break some queries.

  Message: 
System.TypeInitializationException : The type initializer for 'Microsoft.EntityFrameworkCore.EnumerableMethods' threw an exception.
  ----> System.InvalidOperationException : Sequence contains more than one matching element

  Stack Trace: 
EnumerableMethods.get_AnyWithPredicate()
AllAnyToContainsRewritingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
MethodCallExpression.Accept(ExpressionVisitor visitor)
ExpressionVisitor.Visit(Expression node)
QueryTranslationPreprocessor.Process(Expression query)
QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
Database.CompileQuery[TResult](Expression query, Boolean async)
QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
<>c__DisplayClass9_0`1.<Execute>b__0()
CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
<17 more frames...>
ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
ContextUtils.DoIsolated(ContextCallback callback, Object state)
ContextUtils.DoIsolated[T](Func`1 func)
SimpleWorkItem.PerformWork()
--InvalidOperationException
ThrowHelper.ThrowMoreThanOneMatchException()
Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
EnumerableMethods.cctor()

I managed to get it to work by updating this library to use .Net 6 as well.

An update to EFCore6 does not seem required.

@ikijano ikijano linked a pull request Jan 19, 2023 that will close this issue
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 a pull request may close this issue.

1 participant