<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4986175377975342993</id><updated>2012-02-16T11:54:46.729-05:00</updated><category term='C#'/><category term='design pattern'/><category term='MVC3'/><category term='ELMAH'/><category term='git github submodule'/><category term='git github'/><category term='ninject'/><category term='decorator'/><category term='.Net'/><category term='Log4Net'/><category term='Configuration'/><title type='text'>Convention Over Configuration</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kenny-bu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4986175377975342993.post-871127423623803373</id><published>2011-08-10T22:32:00.000-04:00</published><updated>2011-08-10T22:32:45.622-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='decorator'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='ninject'/><title type='text'>The Decorator Pattern with Ninject</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-oRIhhhGIYKw/TkM---U7w1I/AAAAAAAAFSs/p999FX5k2JQ/s1600/DecoratorCapture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="209" src="http://4.bp.blogspot.com/-oRIhhhGIYKw/TkM---U7w1I/AAAAAAAAFSs/p999FX5k2JQ/s400/DecoratorCapture.PNG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Decorator_pattern"&gt;Decorator Pattern&lt;/a&gt;&amp;nbsp;is an excellent way to add functionality to existing objects at run time while honoring the &lt;a href="http://en.wikipedia.org/wiki/Open_Closed_Principle"&gt;open/closed&lt;/a&gt; principle. I decided to put together a &lt;a href="https://github.com/KennyBu/DesignPatternTests"&gt;sample project&lt;/a&gt; demonstrating this pattern in C# along with the DI container&amp;nbsp;&lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4986175377975342993-871127423623803373?l=kenny-bu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/871127423623803373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/871127423623803373'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/2011/08/decorator-pattern-with-ninject.html' title='The Decorator Pattern with Ninject'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-oRIhhhGIYKw/TkM---U7w1I/AAAAAAAAFSs/p999FX5k2JQ/s72-c/DecoratorCapture.PNG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4986175377975342993.post-397735798919819804</id><published>2011-08-03T15:42:00.002-04:00</published><updated>2011-08-11T07:01:01.569-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git github submodule'/><title type='text'>Git Workflow With Submodules</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?s=140&amp;amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?s=140&amp;amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" /&gt;&lt;/a&gt;&lt;/div&gt;This quick and raw post describes the typical workflow of using Git with submodules...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;When a submodule is updated within the scope of the same project&lt;/b&gt;&amp;nbsp;(and you want the latest submodule changes)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;git pull (in the root)&lt;/li&gt;&lt;li&gt;git submodule update (in the root)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;When a&amp;nbsp;submodule is updated in the scope of another project&lt;/b&gt;&amp;nbsp;(and you want those changes in another project which references the submodule)&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;git checkout branchname (in the submodule directory)&lt;/li&gt;&lt;li&gt;git pull origin branchname&amp;nbsp;(in the submodule directory)&lt;/li&gt;&lt;li&gt;git add -A (in the root)&lt;/li&gt;&lt;li&gt;git commit (in the root)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4986175377975342993-397735798919819804?l=kenny-bu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/397735798919819804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/397735798919819804'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/2011/08/git-workflow-with-submodules.html' title='Git Workflow With Submodules'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4986175377975342993.post-7589428305570334655</id><published>2011-07-28T10:18:00.004-04:00</published><updated>2011-07-29T11:30:33.624-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git github'/><title type='text'>Git Cheatsheet 1.1</title><content type='html'>&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?s=140&amp;amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?s=140&amp;amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://twitter.com/#!/Robconery"&gt;Rob Conery&lt;/a&gt;&amp;nbsp;created an excellent Git Cheatsheet as a part of his &lt;a href="http://tekpub.com/view/git/1"&gt;Mastering Git&lt;/a&gt;&amp;nbsp;video series on his training site &lt;a href="http://tekpub.com/"&gt;TekPub&lt;/a&gt;. I decided to tweak this cheat sheet (just a touch) with a few handy git commands:&lt;/div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Git Cheatsheet 1.1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Common Commands&lt;/b&gt;&lt;br /&gt;git init (creates a new repo in the current directory)&lt;br /&gt;git init --shared --bare - create a repo on a share&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Checkin&lt;/b&gt;&lt;br /&gt;git add . (add's all unstaged files to staging)&lt;br /&gt;git commit -m "Message" (commits all unstaged files)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Checkin all changes to tracked files&lt;/b&gt;&lt;br /&gt;git commit -am "Message"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Mistakes&lt;/b&gt;&lt;br /&gt;git checkout -f (undo local changes)&lt;br /&gt;git reset HEAD - points the head to a previous commit, removing all commits inbetween&lt;br /&gt;git revert HEAD - resets the HEAD to the last commit and reverses everything from the&lt;br /&gt;previous commit. It also adds a commit which details the stuff removed, etc.&lt;br /&gt;git reset --hard (in an emergency break glass)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Configuration&lt;/b&gt;&lt;br /&gt;git config --global user.name (sets your username)&lt;br /&gt;git config --global user.email (sets your email)&lt;br /&gt;git config --core.editor (sets your preferred text editor. We suggest "write" - notepad)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Branching&lt;/b&gt;&lt;br /&gt;git checkout -b branchname (creates a branch and switches to it)&lt;br /&gt;git branch branchname (creates a branch)&lt;br /&gt;git branch -D branchname (deletes a branch)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Viewing History&lt;/b&gt;&lt;br /&gt;gitk (brings up the repo viewer for the current branch)&lt;br /&gt;gitk --all (brings up the repo viewer for all branches)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Merge&lt;/b&gt;&lt;br /&gt;git mergetool&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Diff/Merge tools (add to .gitconfig)&lt;/b&gt;&lt;br /&gt;This section assumes p4Merge which you can get from Perforce.com for free. Add your&lt;br /&gt;favorite below as needed, and make sure to order the arguments as needed.&lt;br /&gt;&lt;br /&gt;[diff]&lt;br /&gt;external = "c:/users/username/difftool.sh"&lt;br /&gt;&lt;br /&gt;[merge]&lt;br /&gt;tool = p4merge&lt;br /&gt;&lt;br /&gt;[mergetool "p4merge"]&lt;br /&gt;cmd = "p4merge.exe" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Difftool.sh&lt;/b&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;p4merge "$2" "$5"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Standard Git Ignore&lt;/b&gt;&lt;br /&gt;*resharper.user&lt;br /&gt;[Dd]ebug/&lt;br /&gt;[Rr]elease/&lt;br /&gt;build/&lt;br /&gt;[Bb]in/&lt;br /&gt;[Oo]bj/&lt;br /&gt;*.suo&lt;br /&gt;*.sln.cache&lt;br /&gt;_ReSharper.*/&lt;br /&gt;AssemblyInfo.cs&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Git Hub&lt;/b&gt;&lt;br /&gt;git pull origin branchname&lt;br /&gt;git push origin branchname&lt;br /&gt;git clone githubrepourl&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4986175377975342993-7589428305570334655?l=kenny-bu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/7589428305570334655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/7589428305570334655'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/2011/07/git-cheatsheet-11.html' title='Git Cheatsheet 1.1'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4986175377975342993.post-6041054432463648156</id><published>2011-03-26T17:06:00.004-04:00</published><updated>2011-03-26T17:19:22.343-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='Log4Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Using a Connection String Name with Log4Net AdoNetAppender</title><content type='html'>&lt;a href="http://logging.apache.org/log4net/"&gt;Log4Net&lt;/a&gt; is a great tool to quickly add logging to a .Net application. However one feature that has been missing is the ability to provide a connection string name in the configuration for the&amp;nbsp;AdoNetAppender. Currently out of the box you have to provide the full connection string in the&amp;nbsp;AdoNetAppender configuration settings. This can violate the &lt;a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself"&gt;DRY&lt;/a&gt;&amp;nbsp;principle if the same connection string is already set up in the &lt;a href="http://msdn.microsoft.com/en-us/library/ms254494.aspx"&gt;connectionStrings&lt;/a&gt;&amp;nbsp;section of the configuration.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;So the question is&lt;/b&gt;: How can we enhance the Log4Net&amp;nbsp;AdoNetAppender&amp;nbsp;to have the ability to refer to an already existing connection string defined in the&amp;nbsp;connectionStrings&amp;nbsp;section of the configuration?&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;The good news is that the team behind Log4Net is already working on &lt;a href="https://issues.apache.org/jira/browse/LOG4NET-88"&gt;this feature&lt;/a&gt;. The bad news is that as of now* this feature has not yet been released. This article describes how we can implement a simple solution ourselves.&lt;br /&gt;&lt;br /&gt;1) Create a class that inherits from&amp;nbsp;AdoNetAppender.&lt;br /&gt;2) Next create a ConnectionStringName property that will set the Log4Net ConnectionString property to a connection string that is retrieved by the .Net ConfigurationManager.&lt;br /&gt;3) Create a&amp;nbsp;ConnectionStringName&amp;nbsp;entry in the&amp;nbsp;AdoNetAppender section of&amp;nbsp;&amp;nbsp;your config file which maps to an existing connectionString in the connectionStrings section of your config file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sample Custom AdoNetAppender Class&lt;/b&gt;:&lt;br /&gt;&lt;pre formatcs="1"&gt;using System.Configuration;&lt;br /&gt;using log4net.Appender;&lt;br /&gt;&lt;br /&gt;namespace WebUI.Infrastructure&lt;br /&gt;{&lt;br /&gt;    public class MyCustomAdoNetAppender : AdoNetAppender&lt;br /&gt;    {&lt;br /&gt;        public string ConnectionStringName&lt;br /&gt;        {&lt;br /&gt;            set { ConnectionString = ConfigurationManager.ConnectionStrings[value].ToString(); }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Sample Configuration File&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;configSections&amp;gt; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/configSections&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;log4net&amp;gt; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;appender name="AdoNetAppender" type="&lt;b&gt;WebUI.Infrastructure.MyCustomAdoNetAppender&lt;/b&gt;"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;bufferSize value="1" /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&amp;lt;ConnectionStringName value="MyConnectionName"/&amp;gt; &amp;nbsp;&lt;/b&gt; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!--Additional Info goes here --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/appender&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;root&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;level value="All"/&amp;gt; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;appender-ref ref="AdoNetAppender" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/root&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/log4net&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;connectionStrings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;add name="MyConnectionName"&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; providerName="System.Data.ProviderName"&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; connectionString="Valid Connection String;" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/connectionStrings&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;* 03/26/2011&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4986175377975342993-6041054432463648156?l=kenny-bu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/6041054432463648156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/6041054432463648156'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/2011/03/using-connection-string-name-with.html' title='Using a Connection String Name with Log4Net AdoNetAppender'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4986175377975342993.post-5579053150774592612</id><published>2011-03-25T11:17:00.001-04:00</published><updated>2011-03-25T11:24:25.052-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ELMAH'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC3'/><category scheme='http://www.blogger.com/atom/ns#' term='Log4Net'/><title type='text'>ASP.Net MVC 3 Logging</title><content type='html'>Some useful links to implement ELMAH &amp; Log4Net in an ASP.Net MVC 3 app:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetdarren.wordpress.com/2010/07/29/logging-in-mvc-part-4-log4net/"&gt;Logging Errors with ELMAH in ASP.NET MVC 3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetdarren.wordpress.com/2010/07/27/logging-on-mvc-part-1/"&gt;Logging in MVC&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4986175377975342993-5579053150774592612?l=kenny-bu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/5579053150774592612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/5579053150774592612'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/2011/03/aspnet-mvc-3-logging.html' title='ASP.Net MVC 3 Logging'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4986175377975342993.post-4648229012358908721</id><published>2011-01-13T08:10:00.009-05:00</published><updated>2011-03-26T13:37:01.563-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Well Sometimes You Need Configuration</title><content type='html'>This post describes how to use &lt;b&gt;configSource&lt;/b&gt; in .Net to split up config file settings for developers. This allows us to have standard common config settings in the main web.config or app.config and then have developer specific values in another file.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;This example shows how a developer can set up their own connection strings in a seperate config file that won't affect other developers:&lt;br /&gt;&lt;br /&gt;In the main web.config file replace your regular connectionStrings section with the following:&lt;br /&gt;&lt;br /&gt;&lt;pre formatcs="1"&gt;&lt;connectionstrings configsource="Web.LocalDeveloper.config"&gt;&lt;/connectionstrings&gt;&lt;/pre&gt;&lt;br /&gt;Create a file at the same level in the project as the Web.config file and call it Web.LocalDeveloper.config (or any other standard name your team wishes to use).&lt;br /&gt;In the new Web.LocalDeveloper.config enter your specific settings for your local developer workstation:&lt;br /&gt;&lt;br /&gt;&lt;pre formatcs="1"&gt;&lt;connectionstrings&gt;&lt;br /&gt;  &lt;add connectionstring="data source=(local);Initial Catalog=DBName;Integrated Security=True;Trusted_Connection=true;" name="DBConnection" providername="System.Data.SqlClient"&gt; &lt;br /&gt;&lt;/add&gt;&lt;/connectionstrings&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note: The best practice is to make sure to use .config as the extension of your files so they cannot be served to the browser. Avoid .xml for example or your files can be available to prying eyes.&lt;br /&gt;&lt;br /&gt;Next in our config transform files we can add Xpath expressions to remove the "configSource" entry and add the appropriate configuration entries based on the environment.&lt;br /&gt;&lt;br /&gt;In the following example we remove the configSource and add the DBConnection connection string:&lt;br /&gt;&lt;br /&gt;&lt;pre formatcs="1"&gt;&lt;connectionstrings xdt:transform="RemoveAttributes(configSource)"&gt;&lt;br /&gt;    &lt;add connectionstring="data source=OtherDB;Initial Catalog=OtherSetting;Integrated Security=True;Trusted_Connection=true;" name="DBConnection" xdt:transform="Insert"&gt;&lt;/add&gt;&lt;br /&gt;&lt;/connectionstrings&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4986175377975342993-4648229012358908721?l=kenny-bu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/4648229012358908721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4986175377975342993/posts/default/4648229012358908721'/><link rel='alternate' type='text/html' href='http://kenny-bu.blogspot.com/2011/01/pragmatic-programmer.html' title='Well Sometimes You Need Configuration'/><author><name>KenB</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://1.bp.blogspot.com/-Q_Q7JsdtYuY/Tl6LOarrXvI/AAAAAAAAFVY/dVYNYhyG9FU/s220/Ken.jpg'/></author></entry></feed>
