efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Linq queries not working...

Open pauldalyii opened this issue 11 years ago • 7 comments

I'm currently using:

  • 7.0.0-beta5-12927 nuget package for EntityFramework.Core and
  • 2.0.0-alpha-003 nuget package for Remotion.Linq from https://www.myget.org/F/aspnetvnext/.

I started getting the following exception on all Linq queries within the past week...

System.MissingMethodException was unhandled by user code HResult=-2146233069 Message=Method not found: 'Remotion.Linq.Parsing.Structure.NodeTypeProviders.MethodInfoBasedNodeTypeRegistry Remotion.Linq.Parsing.Structure.NodeTypeProviders.MethodInfoBasedNodeTypeRegistry.CreateFromTypes(System.Collections.Generic.IEnumerable1<System.Type>)'. Source=EntityFramework.Core StackTrace: at Microsoft.Data.Entity.Query.CompiledQueryCache.CreateNodeTypeProvider() at Microsoft.Data.Entity.Query.CompiledQueryCache.CreateQueryParser() at Microsoft.Data.Entity.Query.CompiledQueryCache.<>c__41.b__4_0(Expression q, IDataStore ds) at Microsoft.Data.Entity.Query.CompiledQueryCache.<>c__DisplayClass7_0.b__0(ICacheSetContext c) at Microsoft.Framework.Caching.Memory.CacheExtensions.<>c__DisplayClass7_01.<Set>b__0(ICacheSetContext context) at Microsoft.Framework.Caching.Memory.MemoryCache.Set(String key, IEntryLink link, Object state, Func2 create) at Microsoft.Framework.Caching.Memory.CacheExtensions.Set(IMemoryCache cache, String key, Object state, Func2 create) at Microsoft.Framework.Caching.Memory.CacheExtensions.Set[T](IMemoryCache cache, String key, Object state, Func2 create) at Microsoft.Framework.Caching.Memory.CacheExtensions.GetOrSet[T](IMemoryCache cache, String key, Object state, Func2 create) at Microsoft.Data.Entity.Query.CompiledQueryCache.GetOrAdd(Expression query, QueryContext queryContext, IDataStore dataStore, Boolean isAsync, Func3 compiler) at Microsoft.Data.Entity.Query.CompiledQueryCache.Execute[TResult](Expression query, IDataStore dataStore, QueryContext queryContext) at Microsoft.Data.Entity.Query.EntityQueryProvider.Execute[TResult](Expression expression) at Remotion.Linq.QueryableBase1.GetEnumerator() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)...

Not sure if this is related to #1617

pauldalyii avatar Apr 16 '15 03:04 pauldalyii

Hi Paul!

Thanks for mentioning the versions :) EntityFramework is still linked against Remotion.Linq 2.0.0-alpha-002. There are some API changes in alpha-3, so upgrading to the next alpha isn't possible on the consumer side of things.

Is there a specific reason you updated your project to the latest alpha of Remotion.Linq or is this related to a NuGet package restore peculiarity?

Best regards, Michael

MichaelKetting avatar Apr 16 '15 11:04 MichaelKetting

Interesting. Some of my projects reference 2.0.0-alpha-003 and others 2.0.0-alpha-002. Not exactly sure how I got in this state. I'll put everything back to 002 now and verify.

Thank you!

pauldalyii avatar Apr 16 '15 16:04 pauldalyii

Thanks again Michael... that worked.

pauldalyii avatar Apr 16 '15 16:04 pauldalyii

@MichaelKetting Thanks for helping! Would you recommend upgrading EF7 to use alpha3 now or waiting for another milestone? cc @anpete

divega avatar Apr 16 '15 18:04 divega

@divega You're welcome! Don't think in apha-3 is anything you guys have actually been waiting for so there's no benefit in an immediate upgrade and I'd recommend waiting a bit longer till alpha-4 is done. Don't want to highjack the thread, so the ideas for alpha 4 can be found on our mailing list (https://groups.google.com/d/msg/re-motion-users/7S_39cM0de0/oM_Zz7VHlBgJ)

Best regards, Michael

cc@anpete

MichaelKetting avatar Apr 17 '15 11:04 MichaelKetting

I'm having this problem with the beta4 from nuget. Thanks to this thread, I noticed that in updating an older project from beta3 to beta4, I ended up with the alpha3 of remotion linq. I've spent about the last hour trying to change the version of remotion linq via nuget and have had nothing but problems. What version should I target? The stable 1.15.15? An early pre-release. (resolved...see next comment)

julielerman avatar May 15 '15 18:05 julielerman

I finally got this resolved. I needed to revert to 2.0.0-alpha.002. That installed quickly (rather than hanging for eons when I targetted the stable version) and my linq queries are working. So the working combo is EF7 beta 4 from nuget using Remotion.LINQ alpha002 from nuget.

julielerman avatar May 15 '15 18:05 julielerman