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 have tried implementing migrations on startup. However, I get this error: System.InvalidCastException: 'Unable to cast object of type 'MongoDB.Bson.BsonDocument' to type 'MongoDB.Bson.BsonString'.'
Stack trace:
at MongoDB.Bson.BsonValue.get_AsString()
at Mongo.Migration.Services.DocumentVersionService.GetVersionOrDefault(BsonDocument document)
at Mongo.Migration.Migrations.Document.DocumentMigrationRunner.Run(Type type, BsonDocument document, DocumentVersion to)
at Mongo.Migration.Migrations.Document.StartUpDocumentMigrationRunner.RunAll()
at Mongo.Migration.Services.MigrationService.OnStartup()
at Mongo.Migration.Services.MigrationService.Migrate()
at Mongo.Migration.MongoMigration.Run()
at Mongo.Migration.Startup.Static.MongoMigrationClient.Initialize(IComponentRegistry componentRegistry)
at Mongo.Migration.Startup.Static.MongoMigrationClient.Initialize(IMongoClient client, IMongoMigrationSettings settings, IContainerAdapter containerAdapter)
at Dialogue.Composer.Program.<>c__DisplayClass2_0.<CreateHost>b__0(HostBuilderContext context, IServiceCollection services) in C:\Dev\Microservices\Composer\Dialogue.Composer\Program.cs:line 118
What am I doing wrong here?
This is my init:
IMongoClient clientMongoDB = new MongoClient(databaseSettings.ConnectionString);
MongoMigrationClient.Initialize(clientMongoDB, new MongoMigrationSettings
{
ConnectionString = databaseSettings.ConnectionString,
Database = databaseSettings.DatabaseName
});
The text was updated successfully, but these errors were encountered:
I have tried implementing migrations on startup. However, I get this error:
System.InvalidCastException: 'Unable to cast object of type 'MongoDB.Bson.BsonDocument' to type 'MongoDB.Bson.BsonString'.'
Stack trace:
What am I doing wrong here?
This is my init:
The text was updated successfully, but these errors were encountered: