Hi,
I'm trying out this library for my project, but can't get it set up.
From the samples, I try
var services = new ServiceCollection()
.AddFluentMigratorCore();
My IntelliSense tells me this method is not available and I also couldn't find it in this repo.
I tried this with a console app using .netcoreapp2.2, .netcoreapp2.0, and .NETFramework4.6.1.
My installed nuget packages are
I feel like I'm missing something very simple. Do you know what it could be?
You need the package FluentMigrator.Runner.
EDIT: Please take a look at the quick start tutorial.
My mistake for believing tht FluentMigrator.Runner.SqlServer contained FluentMigrator.Runner.
Thanks for the quick reply!
@maxmantz Same "problem" with PostgreSQL for me. It's really natural to think that FM.Runner.{Db} references FM.Runner.
I'm with this problem. I'm using postgres database and i put
using FluentMigrator.Runner;
using FluentMigrator.Runner.Initialization;
using FluentMigrator;
In the configuration, I used
services.AddFluentMigratorCore()
.ConfigureRunner(rb => rb
// Add SQLite support to FluentMigrator
.AddPostgres()
// Set the connection string
.WithGlobalConnectionString(Configuration.GetConnectionString("DefaultConnection"))
// Define the assemblies containing the migrations
.ScanIn(typeof(CreateApps).Assembly).For.Migrations()
).AddLogging(lb => lb
.AddFluentMigratorConsole());
In configure services. Anyone has an idea about it?
Did you install the package FluentMigrator.Runner?
Yes.
Can you clear your obj and bin directories?
Dll location is driven by MSBuild targets written by Microsoft.
In my scenario I'm only using one specific runner (MySql). So I don't necessarily want to add all the indirect dependencies for the other database types to my project.
It would be nicer to move AddFluentMigratorCore to the FluentMigrator.Runner.Core or to a new FluentMigrator.Runner.DependencyInjection package.
Most helpful comment
In my scenario I'm only using one specific runner (MySql). So I don't necessarily want to add all the indirect dependencies for the other database types to my project.
It would be nicer to move
AddFluentMigratorCoreto theFluentMigrator.Runner.Coreor to a newFluentMigrator.Runner.DependencyInjectionpackage.