I am currently working on creating the InitialCreate migration for a new database. I am new to this migration framework and do not know exactly what it generates, I have been running update-database to see the result, dropping the database then running update-database again after making some changes to see the results.
Twice now I have made some changes, went to run the update and gotten an error like this:
Applying code-based migration: 201209121936571_InitialCreate.
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure “$assemblyName$.resources” was correctly embedded or linked into assembly “$assemblyName$” at compile time, or that all the satellite assemblies required are loadable and fully signed.
at [StackTrace]
Then it ends in red with
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure “$assemblyName$.Migrations.InitialCreate.resources” was correctly embedded or linked into assembly “$assemblyName$” at compile time, or that all the satellite assemblies required are loadable and fully signed.
The first time I encountered this I dropped the migration folder, ran enable-migrations re-made my changes and was able to run the migration.
It has happened again and I am not wanting to have to recreate the files every time this happens. Does anyone know how to correct this to make the migration work again?
I ended up figuring this our in the course of pulling together all the information I wanted for asking the question. Namely, trying to reproduce the issue.
It turns out that if you have a class other than the inheritor of DbMigration as the first class in the file, the Resource file takes the name of the other class and not the migration which breaks the migration.
I have filed a bug report here.