Hi guys, I use abp suite 5.1.2 to create a new module, and it can not generate entity backend service.
- I use it to create a new module, and build the solution.
- Use the CRUD Page Generator to generate a new entity.
- It shows 'An internal error occurred during your request!' error.
- 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:"
8 Answer(s)
-
0
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.<InvokeNextActionFilterAsync>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.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
-
0
Hi, is any support here? has someone try to generate page in Module project came across same exception?
-
0
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:
-
0
@LinchArnold Have you made any changes to *{You_Project_Name}DbContext.cs file after project creation? Can you share the file content?
-
0
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:
- Change the name of DbContext interface file (
I{Your_Project_Name}DbContext.cs
) in your project to something else (example:Random_Name.cs
). - Generate your entity via suite.
- Revert the file name.
- 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.
- Change the name of DbContext interface file (
-
0
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:
- Change the name of DbContext interface file (
I{Your_Project_Name}DbContext.cs
) in your project to something else (example:Random_Name.cs
). - Generate your entity via suite.
- Revert the file name.
- 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.
- Change the name of DbContext interface file (
-
0
I tried to reproduce it with the latest but couldn't reproduce. We specifically need these
1- yourentity.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.
-
0
ok thanks @yekalkan. already fixed and will be delivered in the next patch release. probably in a week or 10 days.