0
votes

Entity Framework 6 was installed on my VS2013 project, had identity 2.0 working fine, when I upgraded the EF6 version using Nuget, and tried to log into the website using a local MySQL Database, I get this failure message, nothing else changed on my end. Only upgraded and ran the project, I had a duplicate copy of the project and checked all the Classes, Models, AppStart, nothing changed so I'm not able to pinpoint what was modified with the upgraded version.

To clarify on the upgrade, prior to upgrading EF6, I upgraded all other installed packages and was able to login to the website without any errors, the only thing left to upgrade was EF6, and once I did, my project fails.

I also checked if anything effected access to other data, using linq queries I'm able to retrieve data from other tables in MySQL database and display on my Views, the only issue I have is when I try to log into the website.

Line 75: var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false); Line 76: switch (result) Line 77: {

Stack Trace:

[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM ((SELECT CASE WHEN (Extent2.UserId IS NULL) THEN (NULL) ELSE (1) END' at line 28] MySql.Data.MySqlClient.MySqlStream.ReadPacket() +383 MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +116 MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId) +54 MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +145 MySql.Data.MySqlClient.MySqlDataReader.NextResult() +1258 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +2484 MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +58 System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) +176 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 System.Data.Entity.Utilities.CultureAwaiter1.GetResult() +123 System.Data.Entity.Core.EntityClient.Internal.d__c.MoveNext() +447

[EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.] System.Data.Entity.Core.EntityClient.Internal.d__c.MoveNext() +549 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 System.Data.Entity.Utilities.CultureAwaiter1.GetResult() +123 System.Data.Entity.Core.Objects.Internal.d__01.MoveNext() +2429 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 System.Data.Entity.Utilities.CultureAwaiter1.GetResult() +123 System.Data.Entity.Core.Objects.<ExecuteInTransactionAsync>d__3d1.MoveNext() +1521 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 System.Data.Entity.Utilities.CultureAwaiter1.GetResult() +123 System.Data.Entity.Core.Objects.d__e.MoveNext() +1075 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 System.Data.Entity.Utilities.CultureAwaiter1.GetResult() +123 System.Data.Entity.Internal.d__0.MoveNext() +538 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 System.Data.Entity.Utilities.CultureAwaiter1.GetResult() +66 System.Data.Entity.Infrastructure.d__251.MoveNext() +463 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 Microsoft.AspNet.Identity.CultureAwaiter1.GetResult() +123 Microsoft.AspNet.Identity.Owin.<PasswordSignInAsync>d__29.MoveNext() +661 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +24 ZA2.UI.Controllers.d__2.MoveNext() in c:\DOCUMENTS\Visual Studio 2013\Projects\ZA2 (mySQL Identity 2.0)\ZA2\ZA2.UI\Controllers\AccountController.cs:75 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter.GetResult() +21 System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task) +61 System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +114 System.Web.Mvc.Async.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) +66 System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +47 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +136 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49 System.Web.Mvc.Async.AsyncInvocationWithFilters.b__3d() +117 System.Web.Mvc.Async.<>c__DisplayClass46.b__3f() +323 System.Web.Mvc.Async.<>c__DisplayClass33.b__32(IAsyncResult asyncResult) +44 System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +47 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +136 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +50 System.Web.Mvc.Async.<>c__DisplayClass2b.b__1c() +72 System.Web.Mvc.Async.<>c__DisplayClass21.b__1e(IAsyncResult asyncResult) +185 System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +133 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40 System.Web.Mvc.Controller.b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +34 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +70 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44 System.Web.Mvc.Controller.b__15(IAsyncResult asyncResult, Controller controller) +39 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +62 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +39 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +70 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514928 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

1
I think you'll have to update MySQL as well.ChiefTwoPencils
MySQL is updated as well, with their latest release, what I am thinking is that I will have to wait for MySQL to come up with a new version to address EF6 latest update. This is like a cat and mouseDavid

1 Answers

0
votes

After upgrading your project to EntityFramework 6.1.2 you get this error from MySQL. EntityFramework 6.1.2 is not generating proper SQL statements to be executed with MySQL Linq queries that use multiple Include methods. You can check the bug details here https://entityframework.codeplex.com/workitem/2673

Downgrade from EntityFramework 6.1.2 to EntityFramework 6.1.1 will solve your problem.

Here is the steps you need to do to downgrade from EF 6.1.2 to EF 6.1.1:

Open Package manager in VS 2013 and execute the following command:

Update-Package EntityFramework -Version 6.1.1

As an alternative test solution, you can download EntityFramework 6.1.1 nuget package here http://pierandev.com/feeds/Default/EntityFramework/6.1.1?redirectIfNotFound=n from the download button at the left side, and open downloaded file with 7-zip or alternative zip extractor then replace your existing EntityFramework 6.1.2 dlls with EntityFramework 6.1.1 dlls extracted from the nuget package file.