I updated MVC4 to MVC5. When you run the application I got an error that I don\'t have WebMatrix.Data
. I installed it PM> Install-Package WebMatrix.Data
Installing MVC 4 (not the runtime but the full version) fixed it for me.
from your package manager console I can see that your project has Successfully added 'WebMatrix.Data 2.0.30506.0' to xxx.`
So get your web.config in sync with WebMatrix.Data 2.0.30506.0
Go into: Tools > NuGet Package Manager > Package Manager Console
And run the following command:
PM> Install-Package Microsoft.AspNet.WebPages.Data
This works as well
Update-Package Microsoft.AspNet.WebPages.Data
This is what worked for me. Took weeks to figure it out.
Make sure your target framework to what you want it to be (I had 4.6.1
).
Go into: Tools > NuGet Package Manager > Package Manager Console
and do the following commands.
Uninstall-Package Microsoft.AspNet.WebHelpers
Uninstall-Package Microsoft.AspNet.WebPages.OAuth
Uninstall-Package Microsoft.AspNet.WebPages.WebData
Uninstall-Package Microsoft.AspNet.WebPages.Data
Install-Package Microsoft.AspNet.WebPages.Data
Install-Package Microsoft.AspNet.WebPages.WebData
Install-Package Microsoft.AspNet.WebPages.OAuth
Install-Package Microsoft.AspNet.WebHelpers
Hope this helps anyone that tried the other solutions with no luck.
This is actually a legacy library. You should instead install Microsoft.AspNet.WebPages.Data if you are upgrading from MVC 4 to 5.
PM> Install-Package Microsoft.AspNet.WebPages.Data