{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Home/issues/294","labels_url":"https://api.github.com/repos/aspnet/Home/issues/294/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Home/issues/294/comments","events_url":"https://api.github.com/repos/aspnet/Home/issues/294/events","html_url":"https://github.com/aspnet/Home/issues/294","id":55741311,"number":294,"title":"Entity framework replacement messes everything up!","user":{"login":"ppumkin","id":1249683,"avatar_url":"https://avatars.githubusercontent.com/u/1249683?v=3","gravatar_id":"","url":"https://api.github.com/users/ppumkin","html_url":"https://github.com/ppumkin","followers_url":"https://api.github.com/users/ppumkin/followers","following_url":"https://api.github.com/users/ppumkin/following{/other_user}","gists_url":"https://api.github.com/users/ppumkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ppumkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppumkin/subscriptions","organizations_url":"https://api.github.com/users/ppumkin/orgs","repos_url":"https://api.github.com/users/ppumkin/repos","events_url":"https://api.github.com/users/ppumkin/events{/privacy}","received_events_url":"https://api.github.com/users/ppumkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-28T10:55:26Z","updated_at":"2015-01-28T11:21:08Z","closed_at":null,"body":"I started a vNext WebMVC project with User Authentication. That all went great, it created the database transparently suing the contexts. No problem.\r\n\r\nI was following a tutorial on how to add my own Context, using the same connection string, since the tutorial was boasting the the latest EF now handles mulitple contexts, migrations, and all that fancy stuff.\r\n\r\nI typed in \r\n\r\n**Enable-Migration**\r\n\r\nError: Entity Framework is NOT installed..\r\n\r\nOK......? using Microsoft.AspNet.Identity.EntityFramework; is not Entity framework then I suppose just the Identity stuff.\r\n\r\nI went to Nuget and isntalled the latest stable version, i started downlaoding all sorts of stuff, npm going nuts with downloads (not sure why now?)  It all installed fine I can see EF 6.1.2\r\n\r\nMy package looks like this\r\n````\r\n   \"dependencies\": {\r\n        \"EntityFramework.SqlServer\": \"7.0.0-beta1\",\r\n        \"EntityFramework.Commands\": \"7.0.0-beta1\",\r\n        \"Microsoft.AspNet.Mvc\": \"6.0.0-beta1\",\r\n        //\"Microsoft.AspNet.Mvc.WebApiCompatShim\": \"6.0.0-beta1\",\r\n        \"Microsoft.AspNet.Diagnostics\": \"1.0.0-beta1\",\r\n        \"Microsoft.AspNet.Diagnostics.Entity\": \"7.0.0-beta1\",\r\n        \"Microsoft.AspNet.Identity.EntityFramework\": \"3.0.0-beta1\",\r\n        \"Microsoft.AspNet.Security.Cookies\": \"1.0.0-beta1\",\r\n        \"Microsoft.AspNet.Server.IIS\": \"1.0.0-beta1\",\r\n        \"Microsoft.AspNet.Server.WebListener\": \"1.0.0-beta1\",\r\n        \"Microsoft.AspNet.StaticFiles\": \"1.0.0-beta1\",\r\n        \"Microsoft.Framework.ConfigurationModel.Json\": \"1.0.0-beta1\",\r\n        \"Microsoft.Framework.CodeGenerators.Mvc\": \"1.0.0-beta1\",\r\n        \"Microsoft.Framework.Logging\": \"1.0.0-beta1\",\r\n        \"Microsoft.Framework.Logging.Console\": \"1.0.0-beta1\",\r\n        \"Microsoft.VisualStudio.Web.BrowserLink.Loader\": \"14.0.0-beta1\",\r\n        \"EntityFramework\": \"6.1.2.0\"\r\n    },\r\n```\r\n\r\nI did not add anything manually. This is all following a tutorial based on MVC4. Nuget Added the last line in and triggered the downloads.\r\n\r\nI now have 61 Errors.\r\n\r\n````\r\n\r\nShow Details\tSeverity\tCode\tDescription\tProject\tFile\tLine\r\n\tError\tCS0012\tThe type 'DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null'.\t```\r\n\r\n\r\nShow Details\tSeverity\tCode\tDescription\tProject\tFile\tLine\r\n\tError\tCS0246\tThe type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)\t.ASP.NET 5.0\t***.cs\t6\r\n\r\nShow Details\tSeverity\tCode\tDescription\tProject\tFile\tLine\r\n\tError\tCS0246\tThe type or namespace name 'ModelBuilder' could not be found (are you missing a using directive or an assembly reference?)\t.ASP.NET Core 5.0\t***.cs\t33\r\n\r\nShow Details\tSeverity\tCode\tDescription\tProject\tFile\tLine\r\n\tError\tCS0311\tThe type '***.DataContexts.IdentityDB' cannot be used as type parameter 'TContext' in the generic type or method 'IdentityEntityFrameworkServiceCollectionExtensions.AddDefaultIdentity<TContext, TUser, TRole>(IServiceCollection, IConfiguration, Action<IdentityOptions>)'. There is no implicit reference conversion from '***.DataContexts.IdentityDB' to 'Microsoft.Data.Entity.DbContext'.\tTimesheep.ASP.NET Core 5.0\tStartup.cs\t41\r\n\r\nShow Details\tSeverity\tCode\tDescription\tProject\tFile\tLine\r\n\tError\tCS0234\tThe type or namespace name 'Metadata' does not exist in the namespace 'Microsoft.Data.Entity' (are you missing an assembly reference?)\t.ASP.NET Core 5.0\tIdentityModels.cs\t5\r\n```\r\n\r\nParticularly in the UserDBCOntext (Which I moved into another file called IdentityDb) it has these using direcrectives. I suppose something is clashing or the the wrong version of EF was installed?\r\n\r\n````\r\nusing System;\r\nusing Microsoft.AspNet.Identity;\r\nusing Microsoft.AspNet.Identity.EntityFramework;\r\nusing Microsoft.Data.Entity;\r\n//using Microsoft.Data.Entity.Metadata;\r\nusing Microsoft.Framework.OptionsModel;\r\nusing Timesheep.Models;\r\nusing System.Data.Entity;\r\n```\r\n\r\n\r\n:(\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Home/issues/comments/71818301","html_url":"https://github.com/aspnet/Home/issues/294#issuecomment-71818301","issue_url":"https://api.github.com/repos/aspnet/Home/issues/294","id":71818301,"user":{"login":"ppumkin","id":1249683,"avatar_url":"https://avatars.githubusercontent.com/u/1249683?v=3","gravatar_id":"","url":"https://api.github.com/users/ppumkin","html_url":"https://github.com/ppumkin","followers_url":"https://api.github.com/users/ppumkin/followers","following_url":"https://api.github.com/users/ppumkin/following{/other_user}","gists_url":"https://api.github.com/users/ppumkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ppumkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppumkin/subscriptions","organizations_url":"https://api.github.com/users/ppumkin/orgs","repos_url":"https://api.github.com/users/ppumkin/repos","events_url":"https://api.github.com/users/ppumkin/events{/privacy}","received_events_url":"https://api.github.com/users/ppumkin/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T11:21:08Z","updated_at":"2015-01-28T11:21:08Z","body":"OK. I rolled everything back and tried to take is slowly. The first thing I noticed.\r\n\r\n```\r\n  public class IdentityDB : IdentityDbContext<ApplicationUser>\r\n    {\r\n        private static bool _created = false;\r\n\r\n        public IdentityDB()\r\n        {\r\n            // Create the database and schema if it doesn't exist\r\n            // This is a temporary workaround to create database until Entity Framework database migrations \r\n            // are supported in ASP.NET 5\r\n            if (!_created)\r\n            {\r\n                Database.AsRelational().ApplyMigrations();\r\n                _created = true;\r\n            }\r\n        }\r\n```\r\n\r\n\r\nThe comments, until EF migrations are supported in ASP.NET5 . Is this still the case or should I be using beta2 packages instead?"}}