Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
abp boilerplate ASP.Net MVC , showing  error AuditingInterceptor.cs not found


What I have tried:

C#
[AbpAuthorize(PermissionNames.Pages_Tenants)]
       public async Task CreateTenant(CreateTenantInput input)
       {
           //Create tenant
           var tenant = input.MapTo<Tenant>();


           tenant.ConnectionString = input.ConnectionString.IsNullOrEmpty()
               ? null
               : SimpleStringCipher.Instance.Encrypt(input.ConnectionString);

           var defaultEdition = await _editionManager.FindByNameAsync(EditionManager.DefaultEditionName);
           if (defaultEdition != null)
           {
               tenant.EditionId = defaultEdition.Id;
           }

           CheckErrors(await TenantManager.CreateAsync(tenant));
           await CurrentUnitOfWork.SaveChangesAsync(); //To get new tenant's id.

           //Create tenant database

           _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);

           //We are working entities of new tenant, so changing tenant filter
           using (CurrentUnitOfWork.SetTenantId(tenant.Id))
           {
               //Create static roles for new tenant
               CheckErrors(await _roleManager.CreateStaticRoles(tenant.Id));

               await CurrentUnitOfWork.SaveChangesAsync(); //To get static role ids

               //grant all permissions to admin role
               var adminRole = _roleManager.Roles.Single(r => r.Name == StaticRoleNames.Tenants.Admin);
               await _roleManager.GrantAllPermissionsAsync(adminRole);

               //Create admin user for the tenant
               var adminUser = User.CreateTenantAdminUser(tenant.Id, input.AdminEmailAddress, User.DefaultPassword);
               CheckErrors(await UserManager.CreateAsync(adminUser));
               await CurrentUnitOfWork.SaveChangesAsync(); //To get admin user's id

               //Assign admin user to role!
               CheckErrors(await UserManager.AddToRoleAsync(adminUser.Id, adminRole.Name));
               await CurrentUnitOfWork.SaveChangesAsync();
           }
       }
Posted
Updated 14-Dec-16 2:54am
v2
Comments
Richard MacCutchan 14-Dec-16 7:45am    
The message is quite clear, that file is missing. you need to find where it is , or fix the code that tries to refer to it.
Member 12308494 14-Dec-16 8:26am    
it is Abp boilerplate run time file, which call from Assembly at run time.
Richard MacCutchan 14-Dec-16 8:34am    
The issue remains the same.

1 solution

Why are you asking us, a bunch of people who have never heard of ABP Boilerplate?

Ask in a forum dedicated to the library you're using, here[^]. See that little "Forum" link at the top of the window? Click it and ask your question in there.
 
Share this answer
 
Comments
Member 12308494 14-Dec-16 9:02am    
Sorry i have disturb you, i have post because some one expert know this answer, i have already posted your given link to forum.
Dave Kreskowiak 14-Dec-16 10:23am    
EDIT: Sorry, wrong post.

The "experts" are going to be in a forum dedicated to the library you're using or contacting the vendor of the library for support.

There are thousands of libraries out in the world. The chances of one of your "experts" on this particular library seeing your post here are very slim.

Mesam Mujtaba 16-Aug-17 5:21am    
Same error.. Could'nt found solution yet
Dave Kreskowiak 16-Aug-17 10:08am    
Again, why would you ask a bunch of people who never heard of Boilerplate instead of going to the people who built it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900