Scaffolding EntityFramework 6 Unable to cast object of type 'System.Data.Entity.Core.Objects.ObjectContext' to 'System.Data.Objects.ObjectContext'

前端 未结 3 1865
情话喂你
情话喂你 2021-02-06 08:01

I wanna use Scaffolding in EntityFrameWork 6, but get this:

Unable to retrieve metadata for \'[myNameSpace].Models.prod\'. Unable to cast object of type \

3条回答
  •  一整个雨季
    2021-02-06 08:43

    ASP.NET MVC 4 scaffolding does not support Entity Framework 6 or later version.

    1.Need to uninstall Entity framework6 or later version Tools->NuGet package manager->Package manager console PM> uninstall-package entityframework -version 6.1.1

    2.Install entity framework 5

    PM> install-package entityframework -version 5.0.0.0

    3.Need to change web.config

    To change as it bellow

提交回复
热议问题