We use the new DbMigration.SqlFile method in EF Migrations 6.1.2 to run the script migration in our migration. According to the documentation , the file should be relative to the current AppDomain BaseDirectory. We included these files in the project and installed them for copying to the output directory. Locally, all this is normal. They are output to the bin directory and work fine.
When you deploy software to a server running IIS, the migration fails because it unexpectedly expects the files to belong to the root. When I copy them there, migration works.
How can I use DbMigration.SqlFile so that it runs correctly both locally and on the server?
source share