{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/Home/issues/1212","repository_url":"https://api.github.com/repos/aspnet/Home","labels_url":"https://api.github.com/repos/aspnet/Home/issues/1212/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Home/issues/1212/comments","events_url":"https://api.github.com/repos/aspnet/Home/issues/1212/events","html_url":"https://github.com/aspnet/Home/issues/1212","id":124983990,"number":1212,"title":"FileNotFoundException when loading EF6 Migrations","user":{"login":"mklaber","id":939816,"avatar_url":"https://avatars.githubusercontent.com/u/939816?v=3","gravatar_id":"","url":"https://api.github.com/users/mklaber","html_url":"https://github.com/mklaber","followers_url":"https://api.github.com/users/mklaber/followers","following_url":"https://api.github.com/users/mklaber/following{/other_user}","gists_url":"https://api.github.com/users/mklaber/gists{/gist_id}","starred_url":"https://api.github.com/users/mklaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mklaber/subscriptions","organizations_url":"https://api.github.com/users/mklaber/orgs","repos_url":"https://api.github.com/users/mklaber/repos","events_url":"https://api.github.com/users/mklaber/events{/privacy}","received_events_url":"https://api.github.com/users/mklaber/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-01-05T15:02:37Z","updated_at":"2017-02-19T18:02:23Z","closed_at":"2017-02-19T18:02:23Z","body":"This is an issue that is similar to #998 and was alluded to in a great blog post called [Entity Framework 6 With ASP.NET 5](http://bleedingnedge.com/2015/11/01/entity-framework-6-with-asp-net-5/) by @pgrudzien12. I've [forked his repository](https://github.com/mklaber/Examples.EntityFramework) and updated it to use `rc1-final`. I've also included the specific exception that happens upon running the web app.\n\nIn short, manual EF migrations (e.g., ones created using `Add-Migration`) cause the following exception: `FileNotFoundException: Could not find file '{Ef Project Namespace}.resources'.` I've replicated this by just starting the web app. I've also tried (in another project) manually calling `Update()` from an instance of `DbMigrator`.\n\nI've also attempted, per #998 to instantiate the [`ResourceManager`](https://github.com/mklaber/Examples.EntityFramework/blob/master/DataAccess/Migrations/201510241112573_InitialDatabase.Designer.cs#L12) more explicitly: `private readonly ResourceManager Resources = new ResourceManager(typeof (InitialDatabase).FullName, System.Reflection.Assembly.Load(typeof (InitialDatabase).Assembly.GetName()));`with no success.\n\nHere's the full stacktrace:\n\n```\nSystem.IO.FileNotFoundException: Could not find file 'WebApplication.DataAccess.resources'.\n   at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)\n   at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)\n   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)\n   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)\n   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\n   at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)\n   at System.Resources.ResourceManager.GetString(String name)\n   at System.Data.Entity.Migrations.DbMigrator.GetDefaultSchema(DbMigration migration)\n   at System.Data.Entity.Migrations.DbMigrator.<GetHistorySchemas>b__6(<>f__AnonymousType10`2 <>h__TransparentIdentifier4)\n   at System.Linq.Enumerable.<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x)\n   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\n   at System.Linq.Enumerable.<ConcatIterator>d__58`1.MoveNext()\n   at System.Linq.Enumerable.<ConcatIterator>d__58`1.MoveNext()\n   at System.Linq.Enumerable.<DistinctIterator>d__63`1.MoveNext()\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\n   at System.Linq.Enumerable.<ReverseIterator>d__74`1.MoveNext()\n   at System.Data.Entity.Migrations.History.HistoryRepository.QueryExists(String contextKey)\n   at System.Data.Entity.Migrations.History.HistoryRepository.Exists(String contextKey)\n   at System.Data.Entity.Migrations.History.HistoryRepository.<GetUpgradeOperations>d__16.MoveNext()\n   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)\n   at System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration)\n   at System.Data.Entity.Migrations.DbMigrator.<>c__DisplayClassc.<Update>b__b()\n   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)\n   at System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)\n   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)\n   at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update()\n   at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)\n   at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState)\n   at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState)\n   at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)\n   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()\n   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)\n   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()\n   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)\n   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)\n   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)\n   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()\n   at System.Data.Entity.Internal.InternalContext.Initialize()\n   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\n   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()\n   at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()\n   at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\n   at WebApplication.Mvc6.Controllers.HomeController.Index() in C:\\Code\\Examples.EntityFramework\\WebApplication.Mvc6\\Controllers\\HomeController.cs:line 21\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at Microsoft.AspNet.Mvc.Controllers.ControllerActionExecutor.ExecuteAsync(MethodInfo actionMethodInfo, Object instance, Object[] orderedActionArguments)\n   at Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker.<InvokeActionAsync>d__6.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\n   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeActionFilterAsync>d__53.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeAsync>d__44.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\n   at Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler.<RouteAsync>d__6.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\n   at Microsoft.AspNet.Routing.Template.TemplateRoute.<RouteAsync>d__27.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\n   at Microsoft.AspNet.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\n   at Microsoft.AspNet.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\n   at Microsoft.AspNet.IISPlatformHandler.IISPlatformHandlerMiddleware.<Invoke>d__8.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\n   at Microsoft.AspNet.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()\n```\n\nMy only workaround is to start an MVC 5 app (which I fortunately still have in my solution) just to run the migration.\n\nMy only theory about what this could be related to is perhaps a limitation in the [`project.json`](https://github.com/mklaber/Examples.EntityFramework/blob/master/wrap/WebApplication.DataAccess/project.json) wrap?\n\nMy apologies, in advance, if I've not posted to this to the most specific repository. If there's a better home for this issue, please let me know and I'll re-post.\n"}}
{"actor":{"display_login":"davidfowl"}}