Sunday, March 1, 2015
How to have different local web config settings for a Visual Studio ASP NET C Web TFS Project
How-I-fixed-it:
The solution is, to split the web.config up into several files and just reference the files using the configSource="sectionName.config" Attribute in the corresponding section in the web.config. Dont add these local files to the project, to not get them overwritten by each other.
Heres a sample:
web.config:
<applicationSettings>
<KCM.Properties.Settings configSource="KCM.Properties.Settings.config" />
</applicationSettings>
KCM.Properties.Settings.config:
xml version="1.0" encoding="utf-8" ?>
<KCM.Properties.Settings>
<setting name="DataStoragePath" serializeAs="String">
<value>D:inetpubftproot</value>
</setting>
</KCM.Properties.Settings>
Here i found the right information to get the solution:
http://code-inside.de/blog/2009/11/03/howto-eine-eigene-configsection-schreiben-custom-configsections/
http://blog.andreloker.de/post/2008/06/16/Keep-your-config-clean-with-external-config-files.aspx
http://www.tomot.de/en-us/article/5/asp.net/how-to-use-web.config-transforms-to-replace-appsettings-and-connectionstrings
https://devio.wordpress.com/2013/04/24/handling-web-config-variants-in-source-control-based-solutions/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment