Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

EF Core 3.1.0 - Method not found: 'System.Collections.Generic.IEnumerable`1

$
0
0

Hi All,

When I'm deploying windows services using EF 3.1.0, the following error has occurred while executing the Linq Query. and it's working perfectly in my local machine, the issue happens while deploying in the windows server 2012 R2.

.Net framework 4.6.1
EF CORE 3.1.0

using (var ctx = new DatabaseContext())
{
var bats = (from bt in ctx.Batches
where bt.Is_Active == true && bt.Is_Completed == false && bt.Is_Locked == false
select new
{
bt.Batch_Id,
bt.Batch_No
}).ToList();

Error:

Method not found: 'System.Collections.Generic.IEnumerable1<!!0> System.Linq.Enumerable.Append(System.Collections.Generic.IEnumerable1<!!0>, !!0)'. : : at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.InsertRuntimeParameters(Expression query)
at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_01.<Execute>b__0() at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func1 compiler) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.GetEnumerator()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at InvitationSrvcs.InvitationService.ReadMsgs(Object s, ElapsedEventArgs e)

Please advise me to fix this issue as soon as possible.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>