5

Hi I'm working with the mvc 5 framework in ASP.Net on a course I'm taking at my school, but I seem to have hit a wall.

I want to go back and add a field value to my main model (Student) class, but of course that means the structure of the database has to change (getting errors when I try to run it). I was told this should be doable with the command "enable-migrations -enableautomaticmigrations" typed into the Package Manager Console, but I seem to get an error message saying it's an unknown command when I type it. Or am I supposed to do something different than using these commands?

Here is the error I'm getting when I write the aforementioned command:

PM> enable-migrations

The term 'enable-migrations' is not recognized as the name of a cmdlet, functio n, script file, or operable program. Check the spelling of the name, or if a pa th was included, verify that the path is correct and try again. At line:1 char:18

Any help is appreciated!

tereško
  • 58,060
  • 25
  • 98
  • 150
ObedMarsh
  • 433
  • 4
  • 19
  • Pretty sure that command is Case Sensitive. Enable-Migrations. – Tony Feb 25 '14 at 17:09
  • I've tried that (another student suggested it) but alas to no avail. :S – ObedMarsh Feb 25 '14 at 17:19
  • Look at this post: http://stackoverflow.com/questions/10411529/package-manager-console-enable-migrations-commandnotfoundexception-only-in-a-spe – Paritosh Feb 25 '14 at 17:21
  • The problem was that my project was located in my dropbox. For some reason my visual studio doesn't like that, moved it locally and everything worked. – ObedMarsh Mar 25 '14 at 22:34

2 Answers2

0

I wonder if you tried reinstalling Entity framework Install-Package EntityFramework -IncludePrerelease. Sometimes the Prerelease version is not included. Try that. If not try Update-Database -Force if you already have a database. One last way is to reopening the project after closing everything in VS.

Dinesh Devkota
  • 1,417
  • 2
  • 18
  • 45
0

The problem was that my project was located in my dropbox. For some reason my visual studio doesn't like that, moved it locally and everything worked.

ObedMarsh
  • 433
  • 4
  • 19