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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:18:35+00:00 2026-05-22T16:18:35+00:00

I am creating web application in C# using ASP.NET MVC and I am using

  • 0

I am creating web application in C# using ASP.NET MVC and I am using MSSQL server installed on my machine.

Also I wanted to publish application as open source project, and run it on production server.
Should I add web.config file to source code repository? If i should, how I should track “open source version” (pointing on MsSQL installed on localhost) and production version (pointing on my hosting of web.config (I am using Mercurial).

  • 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-05-22T16:18:35+00:00Added an answer on May 22, 2026 at 4:18 pm

    The recommended way to do this is as follows:

    1. Create a copy of the public version of the file you’d like people to use as a starting point, and name it something other than the actual usable file. In your case, it could be web.config.template. Make sure the file would be usable if you just renamed it.
    2. Instruct Mercurial to ignore the actual file, ie. web.config
    3. If possible, make the build process figure out if the actual file is present, and if not, make a copy from the template file into the actual file
    4. If step 3 is not possible, a batch file to make the actual file is the next best thing, or simple instructions on how to make it.

    This ensures that:

    1. There is a simple way of getting the actual configuration file
    2. You can edit your local actual configuration file without worrying about committing it (it is ignored)
    3. If step 3 was possible, this is largely transparent unless you need to make modifications to the file

    Step 3 can be handled with a pre-build event for your project, something like:

    if not exist web.config copy web.config.template web.config
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a Web application using ASP.NET MVC, and I'm trying to use
I am creating a mobile web application using asp.net. The application must support iPhone,
When I'm creating a user for my web application, an SMTP email (using ASP.NET's
I am creating a web application using ASP.Net. I am using session in my
I'm creating a web application using asp.net & WCF as 3 tier architecture, which
I'm creating an ASP.NET MVC application using F# on IIS 7. When I attempt
I am creating a new web application using ASP.NET MVC3 Razor and HTML 5.
I'm developing a web application using ASP.NET MVC and I'm using Windsor Castle as
I'm currently creating an application using ASP.NET MVC. I got some user input inside
I am creating an ASP.NET MVC 3 web application which is used for looking

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.