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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:27:45+00:00 2026-06-09T07:27:45+00:00

I am trying to configure transformation rules for a web.config to create or update

  • 0

I am trying to configure transformation rules for a web.config to create or update a connection string. The rules are simple:

  1. If a connection string with a given name (“MyDatabase”) is present, it should not be touched.

  2. If there is no connection string with a given name, it should be inserted.

But I can’t figure out if this is possible. If I just specify “add” element in my web.config.transform, it inserts connectionString element even if there is already one with such name. But if I specify xdt:Transform=”Replace”, then it will be replaced. I’ve found a good article on the subject, and it lists scenarios Replace,Insert,Delete. But I need “InsertIfNotExists”.

Help is appreciated.

  • 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-09T07:27:47+00:00Added an answer on June 9, 2026 at 7:27 am

    The blog Custom web.config transforms and merges describes
    extensions Merge and MergeBefore transforms that would insert an element if it’s missing but leave the element alone if it’s already present.

    To use a custom transform, you have to import the relevant namespace in your transformation XML:

    <xdt:Import assembly="AppHarbor.TransformTester"
        namespace="AppHarbor.TransformTester.Transforms"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to configure an ASP.net Web Application through Web.config, to host
I am trying to configure Entity Framework 4 in the Web.config file using this
I am trying to configure an IIS7 web server to run my IntraWeb 10
Trying to configure Zend_Cache_Backend_Memcached via a config.ini or config.xml file. I'm not sure how
I'm trying to configure a web application that can use client-side JavaScript for localization
I'm trying to configure Apache Tomcat to use SSL connection with client authentication (two
hi im trying to configure an odbcdatasource in visual studio, I have the connection
I'm trying to configure connection pool in Tomcat 7. Here is code: part of
Im trying to configure a .htaccess RewriteRule and i'm struggling. I have a domain
I am trying to configure my xmonad.hs so that when I start my session

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.