-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add-Migration fails on a UWP class library #2784
Comments
(obvious question) Do you have "Microsoft.Framework.Logging.Abstractions" installed in this new project? |
I am having a similar issue. The difference is that I get the same error with a different exception listed:
The migration system was creating migrations in beta5 and before with my context in a project containing my context alone. I initially thought that I had a dangling reference somewhere to beta 5, but that does not appear to be the case. The folders inside my packages folder for the solution include the following:
Are there any packages in the list above that would make you think that I have a dangling reference to an older version of EF7? in my context, the OnConfiguring is setup as follows: protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
if (!optionsBuilder.IsConfigured)
{
#if DEBUG
optionsBuilder.UseSqlServer(@"Server=(localdb)\v11.0;Database=EligibilityTest;Trusted_Connection=True;");
#else
// other default to go here.
optionsBuilder.UseSqlServer(@"Server=(localdb)\v11.0;Database=EligibilityTest;Trusted_Connection=True;");
#endif
}
} I am currently using VS2015 Enterprise in .Net 4.5.1 projects. Interestingly enough, in test code where I ensure that the database is created, it seems to create the database properly. |
I spent about an hour trying to figure this out. The package it is complaining about is pulled in as a dependency from EntityFramework.Sqlite. I actually manually added this to both projects and it still didnt work. This was a brand new project that I created with a simple model. When I move the context to the main project everything works fine. |
Just by inspection, I'm not sure what is wrong. Can you create a project that reproduces this issue? Make sure to add the project.lock.json file so we can see exactly which packages are being used. |
I found what my issue was. Embedded in my project file it was referencing the old beta5 build. I had to remove it from a text editor since NuGet and Visual Studio weren't catching it. You may want to double check the packages folder and make sure that the Microsoft.Framework.Logging.Abstractions folder is present with it's data for the beta version you are using. |
I uploaded a project that was causing my grief: |
Confirmed bug. |
Awesome, I'm not going insane. |
I got to the bottom of this. NuGet 3 (with project.json) no longer copies package assemblies to the output folder for class library projects by default. It's related to NuGet/Home#1084. We're working with the team to figure out a solution. |
I have the same problem when installing Microsoft.EntityFrameworkCore.Design.Core in a UWP class library project. I see my package folder inside the project folder and there isn't a Microsoft.EntityFrameworkCore.Design.Core folder (so many folders..). Maybe the same issue? |
@ericpennachini hard to tell. This issue was supposedly fixed long time ago. I would recommend creating a new issue and filling in all the details (e.g. full error, repro, versions you are using, etc.). |
Thanks. I had not seen that the date of the problem was last year, and I have not much experience in Git. I will try to do what you told me. |
I am having the same issues. EF7 and migrations were working before. Tried to change and add migration and it fails. I deleted and started from scratch and even the first migration fails
|
@hermitdave that is a separate issue. See #5471 for details and a workaround. |
hi @hermitdave i am having the same issue, it was all working fine i created migration in december 2016 and now when i added a column try to run add-migration and i am getting exact same issue.. i tried following #5471 but no luck so far.. still keep getting it .. this is my project json { @divega @natemcmaster any idea what i am missing , i do have the bindings
|
I have given up on using Add-Migration.. created Migration file by hand.. much better use of my time |
I moved my model to a class library (along with the context). When I try and run the command:
I get the following error:
The text was updated successfully, but these errors were encountered: