Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: Migration resource file misnamed if migration is not first class in file [511]

$
0
0
Twice now I have been very confused for a when my migration stopped working. The second time I finally traced it back to being a problem with having the class that inherits from DbMigration not be the first class in the file. Moving the other class to another file or below the migration class allows the migration to run. Details on the error below and project that reproduces the bug attached.

> 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$.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.
at [StackTrace]

The message 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.


Even if there are reasons the migration must be the first class in the file, it would at least be nice if the error suggested something to that effect to the user. The current behavior is very unintuitive.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>