Question

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!

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top