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

EF dependency on non-existing String.Concat __arglist overload #619

Closed
jkotas opened this issue Sep 4, 2018 · 5 comments
Closed

EF dependency on non-existing String.Concat __arglist overload #619

jkotas opened this issue Sep 4, 2018 · 5 comments

Comments

@jkotas
Copy link
Member

jkotas commented Sep 4, 2018

EntityFramework6 uses String.Concat with __arglist overload:
https://github.com/aspnet/EntityFramework6/blob/master/src/EntityFramework/Core/Objects/ELinq/MethodCallTranslator.cs#L1493

if you run this on .NET Core you will get null that leads to crash later.

mono/mono#9996 has more details with a real-world repro.

@jkotas
Copy link
Member Author

jkotas commented Sep 4, 2018

We do not have plans to add cross-plat vararg support to .NET Core in near future. Is it possible to avoid a hard dependency on existence of this method in EF?

@ajcvickers
Copy link
Contributor

@jkotas EF6 currently doesn't run on .NET Core--this is scheduled for .NET Core 3. I expect at that time we can just remove support for the overload, but I haven't fully investigated yet.

@bricelam
Copy link
Contributor

Fixed by #781

@yusufumac
Copy link

@bricelam still having this error. tried updating to the latest nightly build of EF6 (6.3.0-beta1-62412). Any ideas?

Please find the stack trace below.

System.TypeInitializationException: The type initializer for 'MethodCallTranslator' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.InitializeMethodTranslators()
   at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator..cctor()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
   at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
   at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.Convert()
   at System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at System.Linq.Queryable.First[TSource](IQueryable`1 source)
   at api.Controllers.ValuesController.Get() in /Users/umac/Projects/api/api/Controllers/ValuesController.cs:line 22
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
info: Microsoft.AspNetCore.Hosting.Internal.GenericWebHostService[2]
      Request finished in 7332.5288ms 500 text/html; charset=utf-8

@bricelam
Copy link
Contributor

bricelam commented Apr 30, 2019

Our new nightly builds are in this feed:

They also depend on packages in this feed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants