I'm trying to create a console application for generating a SQL Migration script for automation purposes - the same script generated by:
Update-Database -Script
From Package Manager Console.
In the console app I've created I can generate the script if I reference the DLL directly that has my DBMigrationsConfiguration in it.
For example this works:
Note I have a direct reference to the DLL, a using statement and I use a new statement to instantiate the Config object.
Now if I try to do it via reflection I get back null from the line:
DbMigrationsConfiguration configuration = (DbMigrationsConfiguration)assembly.CreateInstance("TAPS.Infrastructure.Migrations, Configuration");
The full code sample follows:
Aucun commentaire:
Enregistrer un commentaire