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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:24:30+00:00 2026-05-25T00:24:30+00:00

For Visual Studio 2010 Web based application we have Config Transformation features by which

  • 0

For Visual Studio 2010 Web based application we have Config Transformation features by which we can maintain multiple configuration files for different environments. But the same feature is not available for App.Config files for Windows Services/WinForms or Console Application.

There is a workaround available as suggested here: Applying XDT magic to App.Config.

However it is not straightforward and requires a number of steps. Is there an easier way to achieve the same for app.config files?

  • 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-25T00:24:30+00:00Added an answer on May 25, 2026 at 12:24 am

    This works now with the Visual Studio AddIn treated in this article: SlowCheetah – Web.config Transformation Syntax now generalized for any XML configuration file.

    You can right-click on your web.config and click “Add Config
    Transforms.” When you do this, you’ll get a web.debug.config and a
    web.release.config. You can make a web.whatever.config if you like, as
    long as the name lines up with a configuration profile. These files
    are just the changes you want made, not a complete copy of your
    web.config.

    You might think you’d want to use XSLT to transform a web.config, but
    while they feels intuitively right it’s actually very verbose.

    Here’s two transforms, one using XSLT and the same one using the XML
    Document Transform syntax/namespace. As with all things there’s
    multiple ways in XSLT to do this, but you get the general idea. XSLT
    is a generalized tree transformation language, while this deployment
    one is optimized for a specific subset of common scenarios. But, the
    cool part is that each XDT transform is a .NET plugin, so you can make
    your own.

    <?xml version="1.0" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="@*|node()">
      <xsl:copy>           
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>
    <xsl:template match="/configuration/appSettings">
      <xsl:copy>
        <xsl:apply-templates select="node()|@*"/>
        <xsl:element name="add">
          <xsl:attribute name="key">NewSetting</xsl:attribute>
          <xsl:attribute name="value">New Setting Value</xsl:attribute>
        </xsl:element>
      </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    

    Or the same thing via the deployment transform:

    <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
       <appSettings>
          <add name="NewSetting" value="New Setting Value" xdt:Transform="Insert"/>
       </appSettings>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

weird issue with visual studio 2010, right now i'm debugging a web application (which
I have a dataset in a Visual Studio 2010 Web App project which accesses
Info: C#, Visual Studio 2010 RC How can I add a WCF Web Service
Visual Studio 2010 RC -> Silverlight Application We have a library of images that
I'm developing a web application in visual studio 2010. I've a list view and
I have a visual studio 2010 web project that when I publish it in
I'm developing a web application in Visual Studio 2010 on Win 7, and now
I'm using ASP.NET web forms in Visual Studio 2010. How can I create UI
Using Visual Studio 2010, I developed a WCF service hosted on a web application
I deployed my web application created with visual studio 2010 to a remote server

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.