Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework Code First Migrations - Enable-Migrations fails

I have been trying to use code-first migrations, and had some limited success, but one of the things I got wrong was that I failed to tell it which project had the config information. It generated some classes for me, and I sort-of got it all working, but I figured that I should sort out the configuration issue and start over.

Bad mistake. Now that I've attempted to remove all the migrations stuff, I find I cannot re-install it. I've un-installed and re-installed EF 5, but when I use the Enable-Migrations command, I get an exception report:

System.Runtime.Serialization.SerializationException: Type is not resolved for member 'System.Data.Entity.Migrations.Design.ToolingFacade+GetContextTypeRunner,EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

No matter what I do now, I can't seem to get past that. Any ideas?

like image 427
Gary McGill Avatar asked Nov 27 '22 04:11

Gary McGill


1 Answers

This happened to me because I had a special character in the path of my project - specifically, an ampersand &. I removed the ampersand and then everything worked like a charm.

like image 159
Laggel Avatar answered Dec 10 '22 09:12

Laggel