Unable to activate type 'FluentMigrator.Infrastructure.DefaultEmbeddedResourceProvider

Viewed 361

I am using FuentMigrator and FluentMigrator.Runner 3.1.3

My Migrations are working fine and are executed against the database. But when i try to execute an embedded resource sql i get the following error message:

Unable to activate type 'FluentMigrator.Infrastructure.DefaultEmbeddedResourceProvider'. The following constructors are ambigious: Void .ctor(System.Collections.Generic.IEnumerable`1[System.Reflection.Assembly]) Void .ctor(FluentMigrator.Infrastructure.IAssemblyCollection)

The constructor for the IAssemblyCollection is marked as obsolete in the documentation but still see as a possible constructor.

I have not found any info on this issue and have used this fuctionality in previous versions of FluentMigrator

my Code in the miration

public override void Up()
    {
        Execute.EmbeddedScript("M201810311049CreateInvoiceOverview_up.sql");
    }

Code for the runner

string connectionString = ConfigurationManager.ConnectionStrings["WorkingWithData"].ConnectionString;
        Announcer announcer = new TextWriterAnnouncer(s => System.Diagnostics.Debug.WriteLine(s));
        announcer.ShowSql = true;

        Assembly assembly = Assembly.GetExecutingAssembly();
        IRunnerContext migrationContext = new RunnerContext(announcer);

        var options = new ProcessorOptions
        {
            PreviewOnly = false,  // set to true to see the SQL
            Timeout = TimeSpan.FromSeconds(60)
        };
        var factory = new SqlServer2014ProcessorFactory();
        using (IMigrationProcessor processor = factory.Create(connectionString, announcer, options))
        {
            var runner = new MigrationRunner(assembly, migrationContext, processor);
            runner.MigrateUp(true);

            // Or go back down
            //runner.MigrateDown(0);
        }
1 Answers

It is a bug in that version of FluentMigrator. Works perfectly in older versions.

Related