Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:01:50+00:00 2026-06-09T13:01:50+00:00

EF migration utility seems quite nice when using code first. Based on this blog

  • 0

EF migration utility seems quite nice when using code first.

Based on this blog post, I tried setting it in my project where we use model-first. When running Enable-Migrations command, I get the following error:

Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel.

Is there any way around it so we can use the EF migration without switching to code-first?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:01:52+00:00Added an answer on June 9, 2026 at 1:01 pm

    I have an incomplete blog entry on how you could do this. Not sure if it will fit your need, but seems to be the only method available so far.

    Basically you use custom t4 to generate DbMigrationsConfiguration and DbContext from your model and you don’t need to run Enable-Migration at all. Simply run Add-Migration and Update-Database in the Package Manager Console.

    http://blog.amusedia.com/2012/08/entity-framework-migration-with-model.html

    I will be update the blog entry and t4 to make it more user friendly later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Another migration question, I have another chunk of VB6 code that seems to need
Making a migration from 2.8.1 to 2.9.1 found interesting thing. Tried to write this
I'm making Liquibase migration using groovy script. I have a code like def migrate()
Using Grails database-migration I have a table in production defined like so: +--------------+------------+------+-----+---------+----------------+ |
I have redesigned my Firebird based SQL database. As part of this process I
This migration seem to be really challenging. What i'm trying to do now is
I have migration project which i have to start to migrate EJB2.1 enterprise web
I'm moving a cmd line migration utility from DEV to QA and I'm running
I have a Rails migration that looks like this: puts *** What would you
After using Migration Assistant (on OS X) to copy my files form a case

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.