Using configSource for appSettings and connectionStrings in web.config not working

articulate's Avatar


08 Dec, 2011 09:05 PM

I have the following sections in my web.config:

<appSettings configSource="AppSettings.development.config" />

<connectionStrings configSource="ConnectionStrings.development.config" />

This works when I deploy to a local IIS instance, however when I deploy AppHarbor this gets broken, because when the app is deployed it adds settings to the appSettings section of the web.config. This results in the following error (YSOD):

A section using 'configSource' may contain no other attributes or elements.

Is there a way I can deploy my code in AppHarbor with leaving my web.config the way that it is. Our web.config and the transformations are setup in the way that the are to facilitate development with our team.


  1. Support Staff 1 Posted by friism on 08 Dec, 2011 10:44 PM

    friism's Avatar

    Hi Mark

    We haven't encountered this problem before. We'll investigate and try to come up with a scheme that works for scenarios like yours.

    Thanks for reporting this.

  2. 2 Posted by articulate on 09 Dec, 2011 03:43 PM

    articulate's Avatar

    I have a work-around for now, but I would like to go back to the other way. Please let me know when you have this figured out.


  3. Support Staff 3 Posted by tt on 09 Dec, 2011 03:49 PM

    tt's Avatar

    Are you using the .NET library to read the configuration values or do you also parse the files manually?

    I'm thinking that since we can't apply partial transformations, we could combine the configuration file into a single document before executing the transformations, but this will break anything that relies on the individual files.

  4. tt closed this discussion on 09 Dec, 2011 03:49 PM.

  5. articulate re-opened this discussion on 09 Dec, 2011 06:03 PM

  6. 4 Posted by articulate on 09 Dec, 2011 06:03 PM

    articulate's Avatar

    This is using the standard web.config processes. I have no code to read the secondary files. See this post: and this one

    The only transformation that I am doing is to change the name of the entry in the configSource attribute to use the appropriate file. Here is what the transformations look like:

    <appSettings xdt:Transform="SetAttributes" configSource="AppSettings.production.config" />
    <connectionStrings xdt:Transform="SetAttributes" configSource="ConnectionStrings.production.config" />
  7. Support Staff 5 Posted by friism on 16 Dec, 2011 04:29 PM

    friism's Avatar

    Hi Mark

    If you add this is a suggestion on the feedback forum we'll extend the configuration file handling as soon as we find time.


  8. 6 Posted by articulate on 20 Dec, 2011 01:26 PM

    articulate's Avatar
  9. Support Staff 7 Posted by friism on 20 Dec, 2011 01:41 PM

    friism's Avatar

    Great, we'll keep you posted.


Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac