locked
Support for ASP.NET Dynamic Data Entities Website project template RRS feed

  • Question

  • User-13302248 posted

    I've used this template in VS 2013 with joyful ease, however, I've revisited this template in VS 2017 and doesn't work anymore. 

    Error:

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

    I used this article with VS 2013 [Go] and got it to work but not with VS 2017.

    Will this continue to be supported? Anyone had any luck getting this to work VS 2017?

    Saturday, January 13, 2018 9:54 PM

Answers

All replies

  • User283571144 posted

    Hi rodchar,

    I used this article with VS 2013 [Go] and got it to work but not with VS 2017.

    Will this continue to be supported? Anyone had any luck getting this to work VS 2017?

    According to this article, ASP.NET MVC 4 scaffolding does not support Entity Framework 6 or higher. Support of scaffolding of Entity Framework 6 is targeted for the next release of ASP.NET MVC.

    Best Regards,

    Brando

    Monday, January 15, 2018 8:54 AM
  • User-330204900 posted

    Actually there is support for EF6 but not 7 you need a NuGet package to make it work, as the EndityDataSources it what causes the issues see Dynamic Data provider and EntityDataSource control for Entity Framework 6.

    The NuGet package is here:

    Microsoft.AspNet.EntityDataSource

    Hope that helps.

    There is one issue the OnSavingChanges is never called by the EntityDataSource replacement that the NuGet package introduces so you wont be able to process anything in there from DD.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 15, 2018 3:49 PM