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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:50:54+00:00 2026-05-20T17:50:54+00:00

I have a solution with several projects and several developers, each with their own

  • 0

I have a solution with several projects and several developers, each with their own environment (of course). To manage connection strings between each environment, I have created several app.config files for each environment: app.config.dev, app.config.qa, etc.

The pre-build event simply copies the app.config.$(ConfigurationName) to app.config. This pre-build event is done for each project in the solution, and the connection string is included in each (including the test project).

When I use the pre-build events to manage the app.config files, the connection string cannot be found. I can get the tests to run fine by 2 methods: 1. Do not use the pre-build events to manage the app.config file selection, and do it myself or 2. If I check out app.config and make it writable, then the pre-build events work just fine.

We are using Visual Studio 2008 with VSS.

I’m down to my last grey hair here, any ideas?
Thanks in advance!

SOLUTION
Update the pre-build event to ensure the app.config file is writable even if it is checked in. Pre-Build event used below:
@echo off

attrib -r $(ProjectDir)app.config
if errorlevel 1 goto AttribFailed

copy $(ProjectDir)app.config.$(ConfigurationName) $(ProjectDir)app.config
goto BuildOK

:AttribFailed
echo Attrib -r Failed on $(ProjectDir)app.config
exit 1

:BuildOK
echo Copy Done

  • 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-20T17:50:55+00:00Added an answer on May 20, 2026 at 5:50 pm

    It sounds like your app.config shouldn’t be under source control – just the build-configuration-specific configuration files (app.config.dev, app.config.qa, etc.).

    Having said that, you can make checked-in files writable under VSS. For example, through windows explorer, uncheck the file’s “Read-only” attribute. (You’ll have to do this each time you check it in.)

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

Sidebar

Related Questions

I have a solution with several projects. One of them is a setup project.
I have a solution with several projects, where the startup project has a post-build
I have a solution containing several projects that have migrated from VS 2003, 2005,
I have a Visual Studio (2008) solution consisting of several projects, not all in
I have several projects and a website in a large asp.net solution. In some
I have a Visual Studio solution that comprises of several projects and are separated
I have several web application projects in one solution. When I start debugging one
I have a solution consisting of five projects, each of which compile to separate
I have a solution with several projects in it that executes many custom build
I have a solution with several projects and all of them are unit test

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.