Closed NazmiAltun closed 4 years ago
@NazmiAltun,
I tried to reproduce in my sample project: Hangfire.Mongo.Sample.AspNetCore.
I use the same configuration
services.AddHangfire(config =>
{
// Read DefaultConnection string from appsettings.json
var connectionString = Configuration.GetConnectionString("DefaultConnection");
var migrationOptions = new MongoStorageOptions
{
MigrationOptions = new MongoMigrationOptions
{
Strategy = MongoMigrationStrategy.Migrate,
BackupStrategy = MongoBackupStrategy.Collections
}
};
//config.UseLogProvider(new FileLogProvider());
config.UseColouredConsoleLogProvider(LogLevel.Trace);
config.UseMongoStorage(connectionString, "hangfire-mongo-sample-aspnetcore", migrationOptions);
});
Can you identify any differences betweem the two setups? what Mongo driver version are you using? thanks
@gottscj Mongo Driver Version 2.9.0 Hangfire.Mongo Version 0.6.3
I call the function as below;
services.AddHangfire(config =>
{
config.UseColouredConsoleLogProvider(Hangfire.Logging.LogLevel.Trace);
var migrationOptions = new MongoStorageOptions
{
MigrationOptions = new MongoMigrationOptions
{
Strategy = MongoMigrationStrategy.Migrate,
BackupStrategy = MongoBackupStrategy.None,
},
};
config.UseMongoStorage(
ApplicationConfiguration.ConnectionString,
$"{ApplicationConfiguration.Database}-Hangfire",
migrationOptions);
});
Or you can check the source code of entire startup.cs here : https://github.com/testokur/TestOkur.WebApi/blob/master/src/TestOkur.Notification/Startup.cs
@NazmiAltun,
It looks OK to me. Could you try MongoDriver 2.8.0? I will update to the latest mongo driver in next release
@gottscj yeah it seems to be working with MongoDriver 2.8.0 .
@NazmiAltun,
Ok, I will make target the new mongo driver for the next release. else a PR would be greatly appreciated. :)
@gottscj I can wait for the next release. No rush :) It is not a major issue anyway.
When i set minimum loglevel in AddHangfire configuration as below;
throws System.MissingMethodException. After setting loglevel back to Debug level, exception no longer occurs. Here is the full details of exception: