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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:04:23+00:00 2026-05-10T17:04:23+00:00

I have an application dependent on some internal web services, and so we want

  • 0

I have an application dependent on some internal web services, and so we want our development and staging configurations to point to the development and staging servers for the web services.

Right now, this means manually editing my app.config file to point to the appropriate URLs. This is not only a hassle, but prone to human error (‘oops, did I not remove that production URL?’ can cause many-a-problem).

In a small handful of places in the code, I use the

#if DEBUG     // do something #endif 

preprocessing statement, and was wondering if something similar could be done for values in the app.config. I’ve been able to do this just fine with my app Settings, since these values are accessible in-code.

I’m aware of post-build scripts, but it seems like there might be an easier way than writing a routine to munge the app.config XML everytime I do a build. Any suggestions?

This is for C#, and .NET 3.5, and includes both old ‘web references’ as well as the newer WCF ‘web services’ references.

  • 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. 2026-05-10T17:04:23+00:00Added an answer on May 10, 2026 at 5:04 pm

    We used a program called XmlPreprocessor from SourceForge to handle this. It allows you to create parameters in your configuration files and different value files to populate them from.

    Given the following files:

    app.config

    ... <importantSetting>$importantSettingValue$</importantSetting> ... 

    qavalues.xml

    ... <importantSettingValue>QAvalue</importantSettingValue> ... 

    prodvalues.xml

    ... <importantSettingValue>PRODvalue</importantSettingValue> ... 

    A command line along the lines of following is all that’s needed to get the correct values in the correct places.

    XmlPreProcess.exe app.config qavalues.xml 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 86k
  • Answers 86k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It can be used for things like making sure PDO… May 11, 2026 at 5:17 pm
  • Editorial Team
    Editorial Team added an answer Is there another way to select an element based on… May 11, 2026 at 5:17 pm
  • Editorial Team
    Editorial Team added an answer The problem is in order to generate the WSDL the… May 11, 2026 at 5:17 pm

Related Questions

A bit long, but, shorter than the first draft :) We have a small
I've long had a desire for an STLish container that I could place into
How would one change the view on the screen programmatically in an iPhone app?
I have an application that was developed for Linux x86 32 bits. There are

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.