Using configSource for appSettings and connectionStrings in web.config not working
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.
Thanks,
Mark
Support Staff 2 Posted by friism on 08 Dec, 2011 10:44 PM
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.
Michael
3 Posted by articulate on 09 Dec, 2011 03:43 PM
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.
Thanks,
Mark
Support Staff 4 Posted by tt on 09 Dec, 2011 03:49 PM
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.
tt closed this discussion on 09 Dec, 2011 03:49 PM.
articulate re-opened this discussion on 09 Dec, 2011 06:03 PM
5 Posted by articulate on 09 Dec, 2011 06:03 PM
This is using the standard web.config processes. I have no code to read the secondary files. See this post: http://weblogs.asp.net/fmarguerie/archive/2007/04/26/using-configso... and this one http://www.nikhilk.net/Entry.aspx?id=158
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:
Support Staff 6 Posted by friism on 16 Dec, 2011 04:29 PM
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.
Michael
7 Posted by articulate on 20 Dec, 2011 01:26 PM
Here it is: http://feedback.appharbor.com/forums/95687-general/suggestions/2464...
Support Staff 8 Posted by friism on 20 Dec, 2011 01:41 PM
Great, we'll keep you posted.
Michael