none
(urgent) Getting "model backing the ... context has changed message" when running add-migration command RRS feed

  • Question

  • I've been using Migrations for several weeks, but I'm now having a serious (and urgent) problem:

    1) I start with a database and data model that are in-sync and operational.

    2) In VS2010 I use the EDM editor, I modify one propery of one object in the data model and rebuild the app (but the database is not yet modified).

    3) I run add-migration command: add-migration App_AddTest1 -conf App -startup myserviceprojectname -project myserviceprojectname -verbose 

    4) I get the message "System.InvalidOperationException: The model backing the 'ModelContainer' context has changed since the database was created. Consider using ..."

    But of course it has changed!  That's why I'm trying to add a migration!!!

    What am I missing????

    DadCat   

    Tuesday, July 3, 2012 4:32 PM

Answers

  • Hi DadCat,

    Welcome to MSDN Forum.

    I've seen the issue in your another thread, could you please clarify what're you achieving? In code first, there's no EDM editor, migrations only support code-first.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by DadCat Thursday, July 5, 2012 5:19 PM
    Wednesday, July 4, 2012 8:04 AM
    Moderator