You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When deploying/attempting to deploy a migration to SqlServer and debugging similar to the samples provided in the repository.
When you try to connect and when enumerating the Migrations, anything called by the runner will result in a "StackOverflowException Operation caused a stack overflow."
staticvoidMain(string[]args){varconnectionString="Data Source=127.0.0.1;Database=TestDatabase;Integrated Security=false;User ID=sa;Password=yourStrong(!)Password;";usingvarservices= CreateServices(connectionString);usingvarscope= services.CreateScope();varrunner= services.GetRequiredService<IMigrationRunner>();if(runner.HasMigrationsToApplyUp()){
runner.MigrateUp();}}static ServiceProvider CreateServices(stringconnectionString){returnnew ServiceCollection()// Add common FluentMigrator services.AddFluentMigratorCore().ConfigureRunner(rb => rb.AddSqlServer()// Set the connection string.WithGlobalConnectionString(connectionString)// Define the assembly containing the migrations.ScanIn(typeof(CreateZipcodeTable).Assembly).For.Migrations())// Enable logging to console in the FluentMigrator way.AddLogging(lb => lb.AddFluentMigratorConsole())// Build the service provider.BuildServiceProvider();}
To Reproduce
Create an example project using SqlServer, and run in container (for purposes of testing)
docker run -e "ACCEPT_EULA=Y"-e "MSSQL_SA_PASSWORD=yourStrong(!)Password"-e "MSSQL_PID=Evaluation"-p 1433:1433-d mcr.microsoft.com/mssql/server:2022-latest
Once up and running use the above migrations project with a connect to the database, create an empty database.
Start debugging hasMigrations to apply with start to throw the exception.
Note that this behaviour seems to be related to the in-process runner as this behaviour doesn't happen when using the DotNet CLI utility.
Expected behavior
Migrations are enumerated correctly and applied/skipped.
Information (please complete the following information):
OS: Windows 10
Platform - .NET 8
FluentMigrator version - 5.2.0
FluentMigrator runner - "in-process runner"
Database Management System - SQLServer
Database Management System Version - SqlServer 2022
The text was updated successfully, but these errors were encountered:
This example is not compile-able but its worth nothing everything that the .NET Cli does is using the DI extensions under the hood. There is no magic, so it is likely a bug in your code somewhere.
Describe the bug
When deploying/attempting to deploy a migration to SqlServer and debugging similar to the samples provided in the repository.
When you try to connect and when enumerating the Migrations, anything called by the runner will result in a "StackOverflowException Operation caused a stack overflow."
To Reproduce
Create an example project using SqlServer, and run in container (for purposes of testing)
Once up and running use the above migrations project with a connect to the database, create an empty database.
Start debugging hasMigrations to apply with start to throw the exception.
Note that this behaviour seems to be related to the in-process runner as this behaviour doesn't happen when using the DotNet CLI utility.
Expected behavior
Migrations are enumerated correctly and applied/skipped.
Information (please complete the following information):
The text was updated successfully, but these errors were encountered: