Could not load file or assembly 'WebMatrix.Data`

别说谁变了你拦得住时间么 提交于 2019-12-03 04:15:29
VINICIUS SIN

Go into: Tools > NuGet Package Manager > Package Manager Console

And run the following command:

PM> Install-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

This works as well

Update-Package Microsoft.AspNet.WebPages.Data

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

Installing MVC 4 (not the runtime but the full version) fixed it for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!