How can I disable migration in Entity Framework 6.0

Michel Borges picture Michel Borges · Sep 6, 2013 · Viewed 72.2k times · Source

I'm trying to ignore the "Automatic" migration using Entity Framework 6.0 rc1. My problem is that I don't want this feature right now and every time that my application runs I can see all entity logs trying to create all tables.

Anticipate thanks.

Answer

Carlos Teixeira picture Carlos Teixeira · Jan 22, 2015

You can put this inside your entityFramework section of the app.config:

<contexts>
  <context type="YourNamespace.YourDbContext, YourAssemblyName" disableDatabaseInitialization="true"/>
</contexts>

This msdn page tells all about the Entity Framework Configuration Section.