Showing posts with label net. Show all posts
Showing posts with label net. Show all posts
Sunday, March 1, 2015
How to have different local web config settings for a Visual Studio ASP NET C Web TFS Project
Today we started an ASP.NET C# Project under VisualStudio 2012 using Team Foundation Server. We ran into the problem that we need to store some local path settings in the web.config file, but they are different on every developers computer.
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:
Read more »
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/
Saturday, February 28, 2015
Where can I find online tutorials to learn C NET programming
I was looking for online tutorials to learn and improve C# programming. Here is just a list of tutorials I found to remember them and to share.
List of C# tutorials:
http://www.tutorialspoint.com/csharp/index.htm
http://www.csharp-station.com/
http://www.csharpme.de/
http://msdn.microsoft.com/en-us/library/aa288436%28v=vs.71%29.aspx
http://openbook.galileocomputing.de/csharp/
Read more »
List of C# tutorials:
http://www.tutorialspoint.com/csharp/index.htm
http://www.csharp-station.com/
http://www.csharpme.de/
http://msdn.microsoft.com/en-us/library/aa288436%28v=vs.71%29.aspx
http://openbook.galileocomputing.de/csharp/
Subscribe to:
Posts (Atom)