- ABP Framework version: v6.0.1
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hello, We are working on a project where we might require multiple different seeders for our database. However, when i run the command 'dotnet run' from DbMigrator, conflicts occur. Mainly, Data about users are tried to br used before user seed data can be defined. To solve this, i have tried the solution in the link below: https://github.com/abpframework/abp/issues/2417 This solution works for the seeders i have defined myself, but when i include the 'OpenIddictDataSeedContributor', dotnet run command generates an error. I have also modified the OpenIddictDataSeedContributor a bit to solve this problem, and the picture uploaded will be that version. The codes, and the error generated are given below.
We hope to hear From You Soon.
7 Answer(s)
-
0
hi
obiect reference rot set to an instance ot an object.
Can you try to debug the code to see which object is null?
-
0
I have tried this. However, i could not trigger any brakpoints when running dotnet run from the terminal. Is there another way of debugging?
-
0
hi
You can debug the code on Visual Studio.
-
0
I tried different debugging methods, but unfortunately I was unable to get my debugger to trigger any breakpoints. Can you specify what type of debugging should be done? Maybe There are some settings I may not know or haven't tried.
-
0
hi
Did you set the breakpoints and Debug the
DbMigrator
in Visual Studio? -
0
-
0
Hello. Sorry for the late response. I tried some other methods. In the end, i tried inserting the highlighted lines in the first picture into the code. Doing so generated the result in the second picture.
@Anil, no need to do this. Create your own DataSeeders, these will run one by one (not random) also you can create a new empty EF Core migration
dotnet ef migrations add MyNewMigration
. And write your SQL inserts here in the empty migration file, write T-SQL inserts...public partial class Insert_Into_MyTable : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.Sql(@"INSERT INTO MyTable ....."); } }