Activities of "LinchArnold"

Answer

Abp suite 5.1.2

  1. Use Abp Suite to create a new module
  2. build the solution
  3. add a new entity
  4. save and generate, the console shows errors: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')

Hi guys, I use abp suite 5.1.2 to create a new module, and it can not generate entity backend service.

  1. I use it to create a new module, and build the solution.
  2. Use the CRUD Page Generator to generate a new entity.
  3. It shows 'An internal error occurred during your request!' error.
  4. the console shows Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex') details.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.1.2
  • UI type: Angular / MVC / Blazor
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): N/A
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Error details:

Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')
   at System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex, Int32 count, CompareOptions options)
   at System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)
   at System.String.IndexOf(String value, Int32 startIndex, StringComparison comparisonType)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.CvMwA8dFmX(String  , String  , String  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.da8wKZL4Py(String  , String  , Boolean  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.dsxw7tsdx3(String  , String  , Boolean  , DatabaseProvider  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.LM8wSX1JwZ(String  , DatabaseProvider  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.wxHwpn1kEW()
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.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_method2227(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(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.&lt;InvokeNextActionFilterAsync&gt;g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeInnerFilterAsync&gt;g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Hi, is any support here? has someone try to generate page in Module project came across same exception?

Hi again @LinchArnold,

Now I reproduced the issue, fixed it internally and added it to next patch release.

For now, i can provide you a simple but dirty workaround if this is urgent for you:

  1. Change the name of DbContext interface file (I{Your_Project_Name}DbContext.cs) in your project to something else (example: Random_Name.cs).
  2. Generate your entity via suite.
  3. Revert the file name.
  4. Manually add the new entity to DbContext interface file. (Line to add: DbSet<{Your_Enttiy's_Name}> {Your_Entity's_Name_Plural} { get; set; })

Be sure to rename both MongoDb & EfCore DbContext interfaces before entity generation, but do not take any action for DbContext classes.

Hi, thanks for your reply, I'll take the steps you provide to avoid the exceptions. Best regards.

I tried to reproduce it with the latest but couldn't reproduce. We specifically need these
1- your entity.json
2- the following information:

  • ABP Framework version:
  • UI type: Angular / MVC / Blazor
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular):
  • Steps to reproduce the issue:

Hi, I am preparing a new Module project and try to reproduce it and share the project to github. But @yekalkan has reproduced the problem.

I use abp suite 5.2.0 to create a new module template, the angular project has import AccountAdminConfigModule.forRoot() by default, but I cannot find any related tabs for account pro:

  1. no account permission tab
  2. no account setting tab

I create a new project template by abp suite 5.2.0, the account related tabs is exist, this problem seems only exist in module template.

  • ABP Framework version: v5.2.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): /

Is it separate identity server or not?

The module template is seperate identity server

This is not just happen in new module template of 5.2.0, when I upgrade my module from 5.1.3 to 5.2.0, the account tabs is also disappear.

In separate IdentityServer solutions, the Account module is served under IdentityServer. Nevertheless, the permissions should be available in the angular application.

I will create an internal issue about this problem.

Thank you, I have refunded your credit.

Thank you.

Showing 1 to 10 of 27 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11