Hello,
We are in the process of upgrading from 10.5.0
to 12.4
("ASP.NET ZERO - ASP.NET Core Version" according to the readme).
After getting our .NET solution building and running again post-upgrade, we are now getting exceptions thrown when EF Core bulk extension methods (like dbContext.BulkInsert
or dbContext.bulkUpdate
, which we use often) are called:
Exception: ERROR_005: The monthly trial period is expired (date: 2023-11-01, version: 7.100.0.3). You can extend your trial by downloading the latest version as the beginning of every month. More information can be found here: https://entityframework-extensions.net/trial
Now, we directly reference the package EFCore.BulkExtensions
EFCore.BulkExtensions
5.4.0
to 6.0.3
EFCore.BulkExtensions
, the actual package that appears to be used internally is Z.EntityFramework.Extensions.EFCore
I found a similar question from a couple years ago at EntityFrameWork Extentions Trial #10457 | Support Center (aspnetzero.com). In it, a Support member said:
ismcagdas created 2 years ago
https://entityframework-extensions.net/ library is a paid library and it is not included in AspNet Zero. https://entityframework-plus.net/ on the other hand is provided by the same company and it is free. We are using this one in AspNet Boilerplate.
But the "Entity Framework Plus" edition you've mentioned (https://entityframework-plus.net/download) mentions that the Enterprise version, which we need and have been using for Bulk Insert/Update/Delete, says "Trial enabled until end of month", which I believe is our issue.
Our questions are:
EFCore.BulkExtensions
, then why is Z.EntityFramework.Extensions.EFCore
being used - is this expected?
Abp.EntityFrameworkCore.EFPlus
is Z.EntityFramework.Plus.EFCore
? Should we not have direct references to EFCore.BulkExtensions
in our project?This is an issue for us because we want to keep our solution up-to-date with the latest version of ABP for security and features, but this has broken our extensive use of bulk operations in EF Core.
Any assistance is appreciated.
Thanks!
Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
This was not an issue before our upgrade, but after we upgraded from 9.1 to 10.5 it is an issue. Here are the steps to reproduce:
ERROR 2021-11-24 11:12:36,753 [53 ] Mvc.ExceptionHandling.AbpExceptionFilter - An error occurred while updating the entries. See the inner exception for details.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.AbpUserLogins' with unique index 'IX_AbpUserLogins_ProviderKey_TenantId'. The duplicate key value is (quIjhGZFWNlG87cGxfx-74_tHkCsLenxh2TWtrgbs_E, 1).
The statement has been terminated.
at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__169_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskContinuation.cs:line 190
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 215
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2352
--- End of stack trace from previous location ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
ClientConnectionId:658596fa-44ef-4568-af42-2db7bb0269b7
Error Number:2601,State:1,Class:14
--- End of inner exception stack trace ---
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(DbContext _, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Abp.EntityFrameworkCore.AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken)
at Abp.Zero.EntityFrameworkCore.AbpZeroCommonDbContext`3.SaveChangesAsync(CancellationToken cancellationToken)
at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesAsync()
at Stantec.ProjectLifeboat.Web.Controllers.TokenAuthController.RegisterExternalUserAsync(ExternalAuthUserInfo externalLoginInfo) in /build/src/Stantec.ProjectLifeboat.Web.Core/Controllers/TokenAuthController.cs:line 608
at Stantec.ProjectLifeboat.Web.Controllers.TokenAuthController.ExternalAuthenticate(ExternalAuthenticateModel model) in /build/src/Stantec.ProjectLifeboat.Web.Core/Controllers/TokenAuthController.cs:line 495
at lambda_method5244(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCom