Base solution for your next web application
Open Closed

Getting Error after Upgrading to Abp 0.9.0 #1116


User avatar
0
maharatha created

Hi -

I am getting errors after updating to Abp 0.9.0. I guess you need to release the Abp Zero upgraded version as well else I am unable to proceed further. Some of the errors are :

1)No overload for method 'SubscribeToAllAvailableNotificationsAsync' takes 2 arguments

  1. Argument 4: cannot convert from 'long[]' to 'Abp.UserIdentifier[]'

  2. cannot convert from 'long' to 'Abp.UserIdentifier'


12 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Yes, we will release AspNet Zero v1.10 tomorrow. There are some minor breaking changes in this version, please read our blog post in detail: <a class="postlink" href="http://volosoft.com/aspnet-boilerplate-v0-9-and-aspnet-zero-v1-10-have-been-released/">http://volosoft.com/aspnet-boilerplate- ... -released/</a>

  • User Avatar
    0
    maharatha created

    Thanks Hilkan. Yes I have gone through the blog and pretty excited about the Hybrid model you are introducing. I originally planned to take this route but with the Abp limitation had cancelled it. But with this release I am really excited.

    This is the most important update you guys are pushing out and I thank you for all the effort you and your team have put into this

  • User Avatar
    0
    maharatha created

    Here we go !!

    I have started updating to latest Abp Zero you guys released today and below is my problem :

    1. Error CS7036 There is no argument given that corresponds to the required formal parameter 'roleId' of 'UserRole.UserRole(int?, long, int)'

    2. 'DefaultLanguagesCreator' is an ambiguous reference between 'XXXXX.Migrations.Seed.Host.DefaultLanguagesCreator' and XXXXXX.Migrations.Seed.DefaultLanguagesCreator'

    Please help.

  • User Avatar
    0
    maharatha created

    Sorry to be impatient but a quick response is much appreciated. I am kind of in the middle of my upgrade and have spent quite some time to upgrade it and this is the last piece which is preventing me to compile it.

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    1. If you check UserRole entity, you will see that it waits 3 arguments: TenantId, UserId and RoleId. We added TenantId as a new parameter. Example usage: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.EntityFramework/Migrations/Seed/Tenants/TenantRoleAndUserBuilder.cs#L86">https://github.com/aspnetzero/aspnet-ze ... der.cs#L86</a>

    2. Moved DefaultLanguagesCreator to Hosts folder. If you have 2 of this file, keep the one in Hosts folder and delete other one (you can compare files to see that they are same/similar).

    Also, for such problems I suggest you to check latest version of the code to compare it with yours.

    Thanks, Have a nice day.

  • User Avatar
    0
    maharatha created

    Hi Hilkan -

    Thank you showing thr right direction. I always to the compare and upgrade, but the code has changed a lot with respect to migration where in Host and Tenant folder has been created. It is no where mentioned to get rid of the old files, though it's obvious but helps people like me who need more of guidance.

    I am able to compile the code and now facing a different issue :

    'XXXX.MultiTenancy.TenantManager' is waiting for the following dependencies:

    • Service 'Abp.MultiTenancy.IAbpZeroDbMigrator' which was not registered.

    I compare the code and it has all the required changes, but I am not sure what's causing this. This up gradation is a difficult one for existing users.

    Quick help is appreciated.

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    I understand you well. Congratulations for your effort to keep up to date. Probably, you will also understand us; This version has huge change. It's impossible to document each change and prepare a migration guide.

    Have you upgraded Abp.Zero.* packages? Because IAbpZeroDbMigrator is defined in that package. Also, your EntityFramework project should contain AbpZeroDbMigrator.cs class (like <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/526f2cbfb3fbd8c08cfb2f63148f5064db72be92/src/MyCompanyName.AbpZeroTemplate.EntityFramework/EntityFramework/AbpZeroDbMigrator.cs">https://github.com/aspnetzero/aspnet-ze ... igrator.cs</a>)

  • User Avatar
    0
    maharatha created

    I am good for now. I missed out the AbpZeroDbMigrator.cs. Do you have source code which only provides file that were changed in a particular release. That would make migration pretty easy

  • User Avatar
    0
    maharatha created

    Weird Issue :

    I am almost there :

    1. When I try to create a tenant in a separate database I am able to do it but once the database is created I am facing foreign key violation issue so the Tenant record is not getting save though the database is created :

    System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.AbpRoles_dbo.AbpTenants_TenantId". The conflict occurred in database "ert", table "dbo.XXX_Tenants", column 'Id'. The statement has been terminated. at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__167_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter1.GetResult() at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.<ExecuteAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter1.GetResult() at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.<UpdateAsync>d__0.MoveNext() --- End of inner exception stack trace --- at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.<UpdateAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown ---

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    You can compare released like that:

    <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/compare/v1.9.1.1...v1.10.0">https://github.com/aspnetzero/aspnet-ze ... ...v1.10.0</a>

    This shows changed, removed and new files.

    You should remove Foreign Key for TenantId since from now they are in different databases (I noticed that in TenantId Foreign Key section in the blog post: <a class="postlink" href="http://volosoft.com/aspnet-boilerplate-v0-9-and-aspnet-zero-v1-10-have-been-released/">http://volosoft.com/aspnet-boilerplate- ... -released/</a>)

  • User Avatar
    0
    maharatha created

    Hi Hilkan -

    Thanks for coming to rescue again. I had gone through the documentation. The migration script also generated the following code :

    DropForeignKey("dbo.XYZ_Settings", "TenantId", "dbo.XYZ_Tenants");

    So when I dug deep I realized the ForeignKey constraint wasn't getting dropped though the migration script was working fine.

    So I had to alter the migration script and add the SQL Script to drop the foreign key constraint

    Sql(@" if exists (select 1 from sys.objects where name = 'FK_dbo.AbpSettings_dbo.AbpTenants_TenantId' and type='F') begin alter table XXX_Settings drop constraint [FK_dbo.AbpSettings_dbo.AbpTenants_TenantId] end");

    Have no clue why this is happening.

    Is it because I am renaming the tables ? Just a wild guess

    But everything works for me now.

    Thank you so much for being so patient

  • User Avatar
    0
    hikalkan created
    Support Team

    It's strange.. I did not understand the reason, maybe about table names but it should throws exception in that case. I noted that and will share if someone has the same problem. Thanks for the solution. Have a nice day.