- ABP Framework version: v7.1.1
- UI Type: Angular
- Database System: EF Core (SQL Server)
- Exception message and full stack trace: 2024-05-24 17:05:59.936 +08:00 [INF] 6/11 - PermissionCommand started... 2024-05-24 17:05:59.937 +08:00 [WRN] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "Cannot find Permissions.cs", "details": null, "data": {}, "validationErrors": null }
2024-05-24 17:05:59.937 +08:00 [WRN] Cannot find Permissions.cs Volo.Abp.UserFriendlyException: Cannot find Permissions.cs at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.PermissionCommand.Ney8Fsho0y() at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.PermissionCommand.u7W8hAGcWy() at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.PermissionCommand.ExecuteAsync(CrudPageCommandOptions options) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution) at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity) at lambda_method1935(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
- Steps to reproduce the issue: when i use abp suite to create new entity and click save and generate , it show error : Cannot find Permissions.cs i have a permission.cs call XXXpermission.cs under Project.XXX.Application.Contracts.Permissions , how can allow abp to find the permission cs to generate code to pass the step 6 generate permission code?
8 Answer(s)
-
0
Hello,
You can call the
IPermissionDefinitionManager.GetGroupsAsync
in theOnApplicationInitialization.
Give it a try. -
0
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
-
0
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.
-
0
Hello,
Thanks for the information. And your abp suite version is also the same 7.1.1, right?
While clicking
save and generate
, ensure your application is not up and running. Check-in Database whetherPermission
tables are present or re-run DBMigrator.If you still face the issue, please check the logs and share more details.
Thanks
-
0
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.
-
0
-
0
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 ?
-
0