Hi,
This is because the abp suite could not find the
Permissions.cs
in your solutionYou can try add a
Permissions.cs
to your application contract project.
there is MyProjectNamePermission.cs under aspnet-core\src\PayKool.CAS.Application.Contracts\Permissions already , but still is the same error [Cannot find Permissions.cs] , will the abp suite find the wrong path ?
An
yes, my abp suite version is 7.1.1, application is not up and running and Permission tables are present . Permission tables are present
log: 2024-05-24 18:31:50.845 +08:00 [INF] 1/11 - EntityGenerateCommand started... 2024-05-24 18:31:52.544 +08:00 [INF] 1/11 - EntityGenerateCommand completed. | Duration: 1697 ms. 2024-05-24 18:31:52.546 +08:00 [INF] 2/11 - RepositoryCommand started... 2024-05-24 18:31:52.733 +08:00 [INF] 2/11 - RepositoryCommand completed. | Duration: 187 ms. 2024-05-24 18:31:52.733 +08:00 [INF] 3/11 - ManagerCommand started... 2024-05-24 18:31:52.760 +08:00 [INF] 3/11 - ManagerCommand completed. | Duration: 26 ms. 2024-05-24 18:31:52.760 +08:00 [INF] 4/11 - AppServiceCommand started... 2024-05-24 18:32:00.368 +08:00 [INF] 4/11 - AppServiceCommand completed. | Duration: 7607 ms. 2024-05-24 18:32:00.369 +08:00 [INF] 5/11 - ProxyControllerCommand started... 2024-05-24 18:32:00.393 +08:00 [INF] 5/11 - ProxyControllerCommand completed. | Duration: 24 ms. 2024-05-24 18:32:00.393 +08:00 [INF] 6/11 - PermissionCommand started... 2024-05-24 18:32:00.416 +08:00 [WRN] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "Cannot find Permissions.cs", "details": null, "data": {}, "validationErrors": null }
2024-05-24 18:32:00.417 +08:00 [WRN] Cannot find Permissions.cs Volo.Abp.UserFriendlyException: Cannot find Permissions.cs
i think the abp suite may find the wrong namespace when finding the Permissions.cs? thanks.
Hello,
You can call the
IPermissionDefinitionManager.GetGroupsAsync
in theOnApplicationInitialization.
Give it a try.
for your information i use dotnet version - 7.0.409 and ABP CLI 7.1.1 and window 11 , the source code is fine with window 10 , but i don't sure if it is matter or other abp version or abp setting related. Thanks.
Hello,
You can call the
IPermissionDefinitionManager.GetGroupsAsync
in theOnApplicationInitialization.
Give it a try.
thanks for your quick response , but i have tried these code var permissionManager = context.ServiceProvider.GetRequiredService<IPermissionDefinitionManager>(); var permissionGroups = permissionManager.GetGroupsAsync().Result; on OnApplicationInitialization , still show the same error when generate code
hi
May not be enough, and other services may get a table not found error. You'd better change this in all projects that reference or indirectly reference to
AbpAuditLoggingEntityFrameworkCoreModule
hi, could you provide some examples of the implementation? I am not sure where and how to add this
hi
You can change this static variable in
Program.cs
of all projectsAbpAuditLoggingDbProperties.DbSchema = "xxx"
As I am using the microservice templeate, only HttpApi.Host contains the program.cs, add the static variable in here in enough?
UseAuditing()
hi, yes I have added this configuration and I found the log is actually inserted into the table with schema dbo dbo.[AbpAuditLogs] dbo.[AbpAuditLogActions] dbo.[AbpEntityChanges] dbo.[AbpEntityPropertyChanges]
Can I customize the schema of these tables? who to override AbpCommonDbProperties?
options.UseSqlServer();
Thank you so much. It resolved the error. However, when doing CRUD of the app service function, there is no record inserted to the AuditLog related tables. What else do I need to configure?
hi
Do you depend on the
AbpAuditLoggingEntityFrameworkCoreModule
on theEntityFrameworkCore
layer?
Yes.
[DependsOn(
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpEntityFrameworkCoreModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule)
)]
In ConfigureServices
Configure< AbpDbContextOptions>(options =>
{
options.Configure< MyServiceDbContext>(c =>
{
c.UseSqlServer(b =>
{
b.MigrationsHistoryTable("__MyService_Migrations", MyServiceDbProperties.DbSchema);
});
});
});