Microsoft.EntityFrameworkCore.InMemory has issue with log exception

asp.net-core entity-framework-core

Question

if we use Microsoft.EntityFrameworkCore.InMemory for unit test , we are facing following exception for asp.net core 2.2

exception is as follows :

   System.TypeLoadException: Could not load type 'Microsoft.Extensions.Logging.Abstractions.Internal.NullScope' from assembly 'Microsoft.Extensions.Logging.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
  Stack Trace: 
    at Logger.BeginScope[TState](TState state)
    at EntityQueryModelVisitor.CreateQueryExecutor[TResult](QueryModel queryModel)
    at InMemoryDatabase.CompileAsyncQuery[TResult](QueryModel queryModel)
    at CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
    at QueryCompiler.ExecuteAsync[TResult](Expression query)
    at IAsyncEnumerable<TResult>.GetEnumerator()
    at AsyncEnumerable.Aggregate_[TSource,TAccumulate,TResult](IAsyncEnumerable`1 source, TAccumulate seed, Func`3 accumulator, Func`2 resultSelector, CancellationToken cancellationToken) in Aggregate.cs line: 118
1
2
10/9/2019 7:21:09 AM

Accepted Answer

Resolve issue with installing Microsoft.EntityFrameworkCore.InMemory with version 2.2.6. The Microsoft.EntityFrameworkCore.InMemory version need to keep the same with project version.

3
10/16/2019 9:02:41 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow