2
I’m using the free hosting service from mee on a free plan. So far so good, everything worked out in a good.
But after I made some changes to my database, their database just doesn’t work, it keeps on going wrong:
The model backing the 'Entidadescontexto' context has changed Since the database was created. Consider using Code First Migrations to update the database
This has already happened to me on my local machine and I resolved using the command line:
Update-Database -Verbose
that forces the database to be updated. And with that everything worked right.
I have done this several times on my local machine before putting it on the air, updated the database, but even so their database service accuses that my context has changed and I have not updated (and I have already done this).
Okay, researching I found that answer from Soen which gives as solution proposal add the following line in the Global.asax:
Database.SetInitializer<YourDbContext>(null);
My questions are, how does this work? And there’s another way I can solve this problem (since I don’t have access to the database because I’m using a plan free)?
Funny thing is, I’ve got Enableautomaticmigrations set to true. And it does not run... Why will it be ? In this second option would delete the bank that is generated along with the application as soon as we create it or the production bank ?
– Érik Thiago
@Érikthiago It would be the production bank. In fact this Bloqueo to the base I find something very clueless. For me it is not even a test.
– Leonel Sanches da Silva
Thanks @Gypsy, I solved it here. Delete the __Migrationhistory record and it worked !
– Érik Thiago
Thank you so much helped me a lot
– Jefferson Mello Olynyki