Base solution for your next web application
Open Closed

New Project Errors after NuGet Update #3386


User avatar
0
blewis created

This is my first ADP project -- we just bought Zero. I downloaded version 4.0.0 and I'm starting a new Asp.Net CORE & jQuery MPA project. When I first load it into VS2017, it compiles and runs. Then I do a NuGet package update, which involves about 45 packages across all of the projects (including many ADP packages). After the update, I get multiple errors:

Error CS1061 'IServiceCollection' does not contain a definition for 'AddAbpIdentity' and no extension method 'AddAbpIdentity' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) NweaCore.Web.Mvc ...\src\NweaCore.Web.Mvc\Startup\Startup.cs 49 Active

Error CS0516 Constructor 'PermissionChecker.PermissionChecker(UserManager)' cannot call itself NweaCore.Core ...\src\NweaCore.Core\Authorization\PermissionChecker.cs 14 Active

For the first error, I can make it go away by changing services.AddAbpIdentity<Tenant, User, Role, SecurityStampValidator>(options => to services.AddAbpIdentity<Tenant, User, Role>(options =>

But I cannot fix the second error no matter what and I cannot compile the solution. Any pointers? Sorry, I am new to the source at this point. Is it typical for errors to crop up when updating ADP packages?

This is a fresh copy of the code, I haven't made any changes at all other than package updates.

Thanks, Bryan


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You should call AddAbpIdentity like this:

    services.AddAbpIdentity<Tenant, User, Role>()
                    .AddAbpSecurityStampValidator<SecurityStampValidator>()
                    .AddAbpUserManager<UserManager>()
                    .AddAbpRoleManager<RoleManager>()
                    .AddAbpSignInManager<SignInManager>()
                    .AddAbpUserClaimsPrincipalFactory<UserClaimsPrincipalFactory>()
                    .AddDefaultTokenProviders();
    

    Actually last version of ABP has some breaking changes, that is why you get such errors. We will release new version of AspNet Zero with latest ABP probably this week.

    Thanks.

  • User Avatar
    0
    john created

    Has this been fixed yet? What was your work around if any?

  • User Avatar
    0
    blewis created

    I think this issue came up because of the time difference between when the general packages were updated and the release of Zero 4.1. I just downloaded 4.1.1 from the web site but haven't been able to try it yet. I will let you know.

    Bryan