none
Old project with entity 4.0 breaks when adding new model or updating an existing model. RRS feed

  • Question

  • i have an old 4.0 project that was using entity 4.0

    in VS2013 if I try to update an existing model or add a new one, it will forcefully install the entity framework 5.0 even though the selection in the box was to use 4.0

    it goes out to nuget to do this and then it will forever add 5.0 even if I uninstall it.

    5.0 getting installed completely breaks my application. References to tables disappear and cross reference for NO reason at all with another model.

    How can i get it to just let me use 4.0 so I can move on OR how can i upgrade my old model into 5.0?

    I'd rather not got tthe 5.0 route because that changes a lot of the ways things were done and would break even more code.


    Friday, March 20, 2015 3:39 PM

Answers

  • I found a work around.

    Open VS2010

    start new project

    add the models

    copy the EDMX to my project

    right click include in project.

    Add in a connection string.

    Works.....highly annoying.

    Friday, March 20, 2015 3:59 PM
  • Hello,

    >>in VS2013 if I try to update an existing model or add a new one, it will forcefully install the entity framework 5.0 even though the selection in the box was to use 4.0

    It is not very clear how you install the Entity Framework, as far as I know, the EF version 4.0 is available with .NET 3.5, from .NET 4.0, it will use the 5.0 by default, if you want to use the EF 4.0, you could change the target to .NET 3.5.

    >>How can i get it to just let me use 4.0 so I can move on OR how can i upgrade my old model into 5.0?

    If it is EF 5.0, as far as I know, it uses the DbContext API instead of the original ObjectContext API(the EF 4.0 uses this API) which provides a better performance, if you want to keep to use ObjectContext API, you could follow this article:

    Reverting Back to ObjectContext Code Generation

    The article shows the configuration for VS2012, for VS2013, you could change the Code Generation Strategy from T4 to Legacy ObjectContext.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 23, 2015 3:15 AM
    Moderator

All replies

  • I found a work around.

    Open VS2010

    start new project

    add the models

    copy the EDMX to my project

    right click include in project.

    Add in a connection string.

    Works.....highly annoying.

    Friday, March 20, 2015 3:59 PM
  • well even the work around is still even more annoying. Cannot update the model in the project unless I go back to the VS2010 project and update it than copy the file back over. 

    So no matter what I do, it wants to update to entity 5 EVEN IF the only option is to use entity 4 which is the option it gives me since 6.0 is greyed out.

    Friday, March 20, 2015 4:42 PM
  • Can I ask what your motivation is to upgrade to VS 2013? Why not stick with VS 2010 for this particular application?
    Friday, March 20, 2015 5:44 PM
  • the project has been a VS2013 project for quite some time and this wasn't an issue until now.
    Friday, March 20, 2015 6:31 PM
  • Hi Zenuke,

    I am moving your thread into the ADO.NET Entity Framework and LINQ to Entities Forum for dedicated support. Thanks for your understanding.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 23, 2015 2:16 AM
  • Hello,

    >>in VS2013 if I try to update an existing model or add a new one, it will forcefully install the entity framework 5.0 even though the selection in the box was to use 4.0

    It is not very clear how you install the Entity Framework, as far as I know, the EF version 4.0 is available with .NET 3.5, from .NET 4.0, it will use the 5.0 by default, if you want to use the EF 4.0, you could change the target to .NET 3.5.

    >>How can i get it to just let me use 4.0 so I can move on OR how can i upgrade my old model into 5.0?

    If it is EF 5.0, as far as I know, it uses the DbContext API instead of the original ObjectContext API(the EF 4.0 uses this API) which provides a better performance, if you want to keep to use ObjectContext API, you could follow this article:

    Reverting Back to ObjectContext Code Generation

    The article shows the configuration for VS2012, for VS2013, you could change the Code Generation Strategy from T4 to Legacy ObjectContext.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 23, 2015 3:15 AM
    Moderator