abp icon indicating copy to clipboard operation
abp copied to clipboard

MissingMethodException Error After Update To 2.7

Open atak946 opened this issue 6 years ago • 7 comments

Hi everyone,

I started getting this error after upgrading the packages to 2.7 via nuget

System.MissingMethodException: Method not found: '!!0 Volo.Abp.Data.HasExtraPropertiesExtensions.SetProperty(!!0, System.String, System.Object)'.
   at Volo.Abp.EntityFrameworkCore.AbpDbContext`1.FillExtraPropertiesForTrackedEntities(EntityTrackedEventArgs e)
   at Volo.Abp.EntityFrameworkCore.AbpDbContext`1.ChangeTracker_Tracked(Object sender, EntityTrackedEventArgs e)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.OnTracked(InternalEntityEntry internalEntityEntry, Boolean fromQuery)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.MarkUnchangedFromQuery()
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTrackingFromQuery(IEntityType baseEntityType, Object entity, ValueBuffer& valueBuffer)
   at Microsoft.EntityFrameworkCore.Query.QueryContext.StartTracking(IEntityType entityType, Object entity, ValueBuffer valueBuffer)
   at lambda_method(Closure , QueryContext , DbDataReader , ResultContext , Int32[] , ResultCoordinator )
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository`3.FindAsync(TKey id, Boolean includeDetails, CancellationToken cancellationToken)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Microsoft.AspNetCore.Identity.SignInManager`1.ValidateSecurityStampAsync(ClaimsPrincipal principal)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Microsoft.AspNetCore.Identity.SecurityStampValidator`1.ValidateAsync(CookieValidatePrincipalContext context)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

how i resolve this problem?

I understand not to encounter this problem in an empty, new project, but my current active project is not working.

The problem is solved when the version is reduced to 2.5. but what do I have to do to use version 2.7?

atak946 avatar May 08 '20 07:05 atak946

I created a new project for version 2.5.0 and upgraded to 2.7.0 ,but i can't reproduce the problem. Can you provide steps to problem?

realLiangshiwei avatar May 08 '20 08:05 realLiangshiwei

I created a new project for version 2.5.0 and upgraded to 2.7.0 ,but i can't reproduce the problem. Can you provide steps to problem?

Step 1- open nuget, Step 2- select volo.abp packages Step 3- upgrade to 2.7.0 Step 4- Presss F5

what is the difference ?

atak946 avatar May 08 '20 10:05 atak946

It works fine for me.

realLiangshiwei avatar May 08 '20 10:05 realLiangshiwei

It works fine for me. @liangshiw

Create new project with cli and use version 2.0.1.

press f5 and check it, all them it works.

upgrade to 2.7.0 and re run.

Important: my project first version is 2.0.1

atak946 avatar May 08 '20 10:05 atak946

Can you use CLI to create a simple project to reproduce the problem?

image

realLiangshiwei avatar May 08 '20 13:05 realLiangshiwei

Hi @atak946,

Can you try to update your project via abp cli (we don't suggest to update ABP versions with NuGet),

First download or update the abp cli. dotnet tool install -g Volo.Abp.Cli dotnet tool update -g Volo.Abp.Cli

Open your sln folder in command prompt then just write abp update. It will update all abp related packages in your whole project to new version. It takes a while. When it is complated, you can check what are changed, if you are using Git.

Also, you can check ABP CLI documentation : https://docs.abp.io/en/abp/latest/CLI

cotur avatar May 08 '20 13:05 cotur

Hi @atak946,

Can you try to update your project via abp cli (we don't suggest to update ABP versions with NuGet),

First download or update the abp cli. dotnet tool install -g Volo.Abp.Cli dotnet tool update -g Volo.Abp.Cli

Open your sln folder in command prompt then just write abp update. It will update all abp related packages in your whole project to new version. It takes a while. When it is complated, you can check what are changed, if you are using Git.

Also, you can check ABP CLI documentation : https://docs.abp.io/en/abp/latest/CLI

@liangshiw @cotur

this way resolved my issue,

nuget packages can't upgrade solution.. best solution is cli -> abp update

thank you for help.

atak946 avatar May 08 '20 14:05 atak946