Could not load file or assembly 'WebMatrix.Data`

前端 未结 6 880
说谎
说谎 2021-02-06 22:22

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

相关标签:
6条回答
  • 2021-02-06 22:30

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

    0 讨论(0)
  • 2021-02-06 22:34

    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

    0 讨论(0)
  • 2021-02-06 22:41

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

    And run the following command:

    PM> Install-Package Microsoft.AspNet.WebPages.Data
    
    0 讨论(0)
  • 2021-02-06 22:45

    This works as well

    Update-Package Microsoft.AspNet.WebPages.Data
    
    0 讨论(0)
  • 2021-02-06 22:51

    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.

    0 讨论(0)
  • 2021-02-06 22:52

    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
    
    0 讨论(0)
提交回复
热议问题