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
I discovered that RelationalDbContextOptionsBuilder.MigrationsAssembly() method must be called last, otherwise the assembly object is removed.
This is because WithOption method makes a clone of the options builder, but the RelationalOptionsExtension constructor is silly and forgets to copy the _migrationsAssemblyObject field.
I would make a PR, but I am scared.
Your code
Mycode? It's not my code!/// <summary>/// Called by a derived class constructor when implementing the <see cref="Clone" /> method./// </summary>/// <param name="copyFrom">The instance that is being cloned.</param>protectedRelationalOptionsExtension(RelationalOptionsExtensioncopyFrom){_connectionString=copyFrom._connectionString;_connection=copyFrom._connection;_connectionOwned=copyFrom._connectionOwned;_commandTimeout=copyFrom._commandTimeout;_maxBatchSize=copyFrom._maxBatchSize;_minBatchSize=copyFrom._minBatchSize;_useRelationalNulls=copyFrom._useRelationalNulls;_querySplittingBehavior=copyFrom._querySplittingBehavior;_migrationsAssembly=copyFrom._migrationsAssembly;// See here for conspicuously missing assignment to_migrationsAssemblyObject_migrationsHistoryTableName=copyFrom._migrationsHistoryTableName;_migrationsHistoryTableSchema=copyFrom._migrationsHistoryTableSchema;_executionStrategyFactory=copyFrom._executionStrategyFactory;_parameterizedCollectionTranslationMode=copyFrom._parameterizedCollectionTranslationMode;}
Stack traces
Verbose output
EF Core version
9.0.4
Database provider
No response
Target framework
No response
Operating system
No response
IDE
No response
The text was updated successfully, but these errors were encountered:
Bug description
I discovered that RelationalDbContextOptionsBuilder.MigrationsAssembly() method must be called last, otherwise the assembly object is removed.
This is because WithOption method makes a clone of the options builder, but the RelationalOptionsExtension constructor is silly and forgets to copy the _migrationsAssemblyObject field.
I would make a PR, but I am scared.
Your code
Stack traces
Verbose output
EF Core version
9.0.4
Database provider
No response
Target framework
No response
Operating system
No response
IDE
No response
The text was updated successfully, but these errors were encountered: