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

  • Home
  • SEARCH
  • 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 8604459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:34:44+00:00 2026-06-12T02:34:44+00:00

I am trying to upload an MVC project in which I use EF 4

  • 0

I am trying to upload an MVC project in which I use EF 4 Code First.

I have stumbled upon the problem that I can only create databases over the admin-console, while EF rigorously demands to create the database itself.

How can I make EF use the (already existing, but empty) database I created for it? The connectionstring is correct and it CAN connect, but I get this error:

Model compatibility cannot be checked because the database does not contain
model metadata. Model compatibility can only be checked for databases created
using Code First or Code First Migrations.
  • 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-12T02:34:45+00:00Added an answer on June 12, 2026 at 2:34 am

    When you have DropCreateDatabaseIfModelChanges as your initializer then the way that EF checks to see if your model has changes is to look at the Model metadata that’s saved in the database and see if there are any changes. Since the database that was previously created had no such metadata in it (since it was created without EF), it had nothing to compare it to, and thus gave you that error.

    To avoid this problem going forward (and without having to use the console), use a different initializer, such as EF 4.3’s MigrateDatabaseToLatestVersion. I did that with an existing database for my project, and it worked just fine.

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

Sidebar

Related Questions

I have an upload function in an MVC 3 project which store the files
In an ASP.NET MVC 3 (Razor) project i 'm trying to upload a picture:
I'm trying to make an App-wide media-upload which should have the possibility of being
I am trying to upload a file with ASP.NET MVC. The following code work
I'm trying to use valums ajax uploader. http://valums.com/ajax-upload/ I have the following on my
I am trying to do upload attachment functionality using MVC. My method that is
I have object street which have some photos. I'm trying to implement upload on
I'm trying to upload files within MVC. Most solution I saw on SO is
I am trying to upload an ASP.NET MVC application in a shared server running
I am trying to upload a single .csv file in ASP.NET MVC. In my

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.