Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 7 "dnx ef migrations add" missing output file

The EF7 command

dnx ef migrations add XXX 

suddenly stopped working. It gives the normal output to the console...

C:\Users\Nikola\Dev\ScanburSandbox\src\ScanburSandbox>dnx ef migrations add XXX
Done. To undo this action, use 'ef migrations remove'

...but the usual .cs and .designer.cs files are not produced.

Question: Can anyone suggest why this can happen or how I can troubleshoot it?

Some more details:

The content of the Migrations-folder before and after running the command looks like this:

11-02-2016  00:03             7.629 00000000000000_CreateIdentitySchema.cs
11-02-2016  00:03             6.637 00000000000000_CreateIdentitySchema.Designer.cs
11-02-2016  00:08             9.688 20160210230810_modelv2.cs
11-02-2016  00:08            10.103 20160210230810_modelv2.Designer.cs
12-02-2016  15:38             8.636 20160212083018_modelv3.cs
12-02-2016  15:38            10.065 20160212083018_modelv3.Designer.cs
12-02-2016  15:38            10.058 ApplicationDbContextModelSnapshot.cs

I have been running the EF7-tools ("dnx ef migrations" and "dnx ef database") with success many times up to now, each time with the expected outcome. This means that "dnx ef migrations add XXX" will add a new .cs and .designer.cs file every time it is executed. This will happen no matter if the model classes have changes or not.

I have no idea how to troubleshoot this tool. I don't see any debug flag or any log-files written anywhere. I don't see any errors in the output.

I really hope someone has bright ideas as I'm stuck here.

like image 903
Nikola Schou Avatar asked Mar 10 '26 09:03

Nikola Schou


1 Answers

I'm having the same problem, I haven't had much luck with specifying the project, context, and output directory. It seems like it's just stalling out and not doing anything. I've also tried running it in an Administrator powershell in-case it's some permission issue, but still nothing.

Edit: I tried adding a new migration on a linux machine and that seemed to create the migration fine. Creating migrations afterwards seems to work perfectly now.

like image 73
user1748837 Avatar answered Mar 13 '26 06:03

user1748837



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!