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 8517821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:48:42+00:00 2026-06-11T05:48:42+00:00

So I have been working on a project using Entity Framework 5 in development

  • 0

So I have been working on a project using Entity Framework 5 in development for a while and it is decided that the code will need to be moved to a production environment.

My question is what would be a good approach to do this?

My initial thought is to have two edmx files in my project and then comment out the production connection string in my development environment and vice-versa in the production environment. However that doesn’t seem feasible as I cannot have two entity model with the same name in the connection string, thus resulting in changing the model “context” instance throughout my code which doesn’t make sense.

Another thought that I had was just to modify the connection string of the model used by the development database to point to the production datasource (since they both have same table structure). But I don’t know if I will break anything here.

I have looked at this post here and it didn’t help: Entity framework working with both production and development database

Note: I am not using the code first pattern but generating the model from the database and that both the development and production database have syncing database structure.

Thanks!

  • 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-11T05:48:44+00:00Added an answer on June 11, 2026 at 5:48 am

    You can use transformations in your web.config file to automatically switch which database you are referencing.

    Check out this similar answer: Web.Config Debug/Release

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

Sidebar

Related Questions

I have been using Entity Framework CTP with Code-First as in this tutorial by
I've been working on a project where I have been using LinqToSQL that involved
I have been working in a .NET Framework 4 project using server tags like
I have been working on a project that dynamically creates a javascript file using
Situation I have been working on a project lately where the UI development seems
So I have been working on this project for a short while now. I
Hey so I have been working on a project that I want to be
I have been working on a C# 4.0 WPF project and need to figure
I have been working on rails project, which had been made using noSql(Mongoid). Every
I have been working on a project where I have a Worker class that

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.