<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brian Sullivan</title>
	<atom:link href="http://www.sullivansoftdev.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sullivansoftdev.com/blog</link>
	<description>From one geek to another</description>
	<lastBuildDate>Sun, 07 Nov 2010 22:17:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Video recording of &#8220;Taking the Pain Out of Web Deployments with MSDeploy&#8221;!</title>
		<link>http://www.sullivansoftdev.com/blog/2010/11/07/video-recording-of-taking-the-pain-out-of-web-deployments-with-msdeploy/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/11/07/video-recording-of-taking-the-pain-out-of-web-deployments-with-msdeploy/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 22:17:32 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=239</guid>
		<description><![CDATA[Shawn Weisfeld, the omnipresent &#8220;video guy&#8221; from INETA, was there to record my presentation at the Northwest Arkansas Code Camp, and the video has been posted to the INETA site.  You can check it out here. I haven&#8217;t watched it yet because, like most people, I hate the sound of my recorded voice.  I&#8217;ll have [...]]]></description>
			<content:encoded><![CDATA[<p>Shawn Weisfeld, the omnipresent &#8220;video guy&#8221; from INETA, was there to record my presentation at the Northwest Arkansas Code Camp, and the video has been posted to the INETA site.  You can check it out <a href="http://live.ineta.org/Presentation/ViewVideo/180">here</a>.</p>
<p>I haven&#8217;t watched it yet because, like most people, I hate the sound of my recorded voice.  I&#8217;ll have to eventually, since it would be a great way to help me pick out my public speaking quirks, but I&#8217;m kind of dreading it. <img src='http://www.sullivansoftdev.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<p>In any case, thanks to Shawn and INETA for recording and hosting the video!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/11/07/video-recording-of-taking-the-pain-out-of-web-deployments-with-msdeploy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speaking Update</title>
		<link>http://www.sullivansoftdev.com/blog/2010/10/26/speaking-update/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/10/26/speaking-update/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 22:11:22 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=236</guid>
		<description><![CDATA[Just a quick note here about some recent and upcoming speaking engagements for me.  A couple of weeks ago,  I gave my Mercurial presentation at Houston Tech Fest.  This conference gets better and more varied every year.  I saw presenations on everything from Xaml styling to the Core Data API for iOS.  I also got to meet Markus Egger, [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note here about some recent and upcoming speaking engagements for me. </p>
<p>A couple of weeks ago,  I gave my Mercurial presentation at Houston Tech Fest.  This conference gets better and more varied every year.  I saw presenations on everything from Xaml styling to the Core Data API for iOS.  I also got to meet Markus Egger, and spoke to him about writing for the project postmortem series in Code Magazine.  I&#8217;m working on a pretty cool project at work right now that I think would be interesting to Code readers, so hopefully I&#8217;ll be able to get started on that soon.</p>
<p>Last week I presented at both the Tyson Developers&#8217; Conference and the Northwest Arkansas Code Camp.  I really enjoyed hanging out with some friends from the Northwest Arakansas area, as well as some of the other guys and gals I&#8217;m beginning to think of as the &#8220;Road Crew&#8221;.  No matter where I&#8217;m speaking, I&#8217;m getting to the point where I know at least a few of the other speakers, not from having worked with them or even lived in the same area, but from speaking at other conferences together before.  It&#8217;s kind of cool to start to feel a part of the &#8220;Brotherhood of the Demo&#8221;.  <img src='http://www.sullivansoftdev.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Coming up soon, I&#8217;ll be speaking in Hattiesburg, MS at the Hub City .NET User Group, run by my friend Keith Elder.  I&#8217;m putting together an intro presentation on Silverlight for that group, which will be an interesting change of pace.  Most of my previous presentations have been fairly advanced or at least niche subjects, but I think having an intro-level talk in my repetoire will advantageous.</p>
<p>Over the weekend, I also found out that one of my submissions got accepted for <a href="http://www.codemash.org">CodeMash</a>!  This will be the farthest I&#8217;ve ever travelled to speak at a conference, and the trip will end up being pretty expensive, but I&#8217;m really looking forward to this one.  The organizers have built up a stellar reputation for CodeMash, evidenced by the fact that all 800 tickets were sold in less than 4 days!  At this one, I&#8217;ll be presenting on the Entity Framework Code-First API that was released as a part of the Community Tech Preview 4 of EF.  Since the API is similar in some respects to Fluent NHibernate, I&#8217;ll be able to port some of the samples I used in my talk on that to the one on EF.</p>
<p>Hope to see you at an event soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/10/26/speaking-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blank Page When Viewing an ASP.NET MVC Web Application</title>
		<link>http://www.sullivansoftdev.com/blog/2010/10/16/blank-page-when-viewing-an-asp-net-mvc-web-application/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/10/16/blank-page-when-viewing-an-asp-net-mvc-web-application/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 04:50:45 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=234</guid>
		<description><![CDATA[Since I recently purchased a new laptop for my personal dev machine, I&#8217;ve been working with a pretty fresh install of Windows 7.  As I was prepping a presentation for Tyson Dev Con next week, I ran into an odd and frustrating problem.  My presentation involves an ASP.NET MVC application, specifically served from IIS rather [...]]]></description>
			<content:encoded><![CDATA[<p>Since I recently purchased a new laptop for my personal dev machine, I&#8217;ve been working with a pretty fresh install of Windows 7.  As I was prepping a presentation for Tyson Dev Con next week, I ran into an odd and frustrating problem.  My presentation involves an ASP.NET MVC application, specifically served from IIS rather than the ASP.NET development server, so I enabled IIS and ASP.NET in the &#8220;Add/Remove Windows Features&#8221; dialog.</p>
<p>I successfully deployed the app to IIS, but when I hit the site, all I got was a blank page.  What was odd was that when I deployed a Web Forms app to IIS, it worked just fine.  This led me to think it was a problem with my MVC installation, but that wasn&#8217;t actually the case.</p>
<p>When you install IIS with the default features enabled, one of the things that is off by default is <strong>HTTP Redirection</strong>.  The first thing the default MVC template application does when you request the root of the app is <em>redirect</em> to Home/Index.  Enabling this IIS feature fixed my problem immediately.</p>
<p>Hopefully this will help someone who runs into the same problem!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/10/16/blank-page-when-viewing-an-asp-net-mvc-web-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speaking at Houston TechFest</title>
		<link>http://www.sullivansoftdev.com/blog/2010/10/04/speaking-at-houston-techfest/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/10/04/speaking-at-houston-techfest/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 00:30:33 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=230</guid>
		<description><![CDATA[I&#8217;ll be speaking at the Houston Tech Fest this Saturday.  I&#8217;ll be doing the same presentation that I did at DevLink, &#8220;Introduction to Distributed Version Control with Mercurial.&#8221;  Planning to get some extra rehearsing done in the next couple of days so it&#8217;ll have a little more polish than last time. I&#8217;m looking forward to the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be speaking at the <a href="http://www.houstontechfest.com/dotnetnuke/default.aspx">Houston Tech Fest</a> this Saturday.  I&#8217;ll be doing the same presentation that I did at DevLink, &#8220;Introduction to Distributed Version Control with Mercurial.&#8221;  Planning to get some extra rehearsing done in the next couple of days so it&#8217;ll have a little more polish than last time.</p>
<p>I&#8217;m looking forward to the Community Leader Town hall the evening before on the Microsoft campus in Houston, led by my friend, <a href="http://jaysmith.us">Jay Smith</a>. Always great to get together with other South Central community leaders!</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/10/04/speaking-at-houston-techfest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DevLink Retrospective</title>
		<link>http://www.sullivansoftdev.com/blog/2010/08/12/devlink-retrospective/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/08/12/devlink-retrospective/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 04:06:57 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=227</guid>
		<description><![CDATA[I had a great experience at DevLink last week. For one thing, I got to hang out with a bunch of really smart people, some of whom I only knew through Twitter or their blogs.  I noticed during the dinner conversations and various Open Spaces sessions was that these guys read&#8230; a lot.  I used [...]]]></description>
			<content:encoded><![CDATA[<p>I had a great experience at DevLink last week.</p>
<p>For one thing, I got to hang out with a bunch of really smart people, some of whom I only knew through Twitter or their blogs.  I noticed during the dinner conversations and various Open Spaces sessions was that these guys read&#8230; <em>a lot</em>.  I used to be a pretty voracious reader, but that seems to have changed in the last few years.  Personal programming projects, research, and experimentation have taken the place of books in my evening routine.  While those activities may help me stay up-to-date technically, I think I&#8217;ve been missing out on bigger picture concepts that will only come from reading.  One of the takeaways from the conference for me was that I need to work on the balance between the two types of learning.  I plan to start going to bed earlier so I can read more.</p>
<p>Another thing that really started to crystallize in my mind at DevLink was that the primary value for me at conferences is networking and discussion with peers.  That&#8217;s not to say that the sessions weren&#8217;t valuable. On the contrary, there was a ton of great content, and I wish I had been able to see more of it.  But I&#8217;m a smart enough guy that I can usually pick up what I need about technical topics online through blog posts, articles, and tutorials.  What I <em>can&#8217;t</em> do every day is meet my peers face-to-face and begin to form relationships that are not only personally rewarding, but that can lead to career enrichment as well.  The various Open Spaces sessions I attended played a big part in this mind shift for me.  Kudos to <a href="http://netcave.org/">Alan Stevens</a> for helping facilitate such a great experience for the DevLink attendees.</p>
<p>I also got to hang out with some former co-workers from Praeses.  They took me to a restaurant where I watched my first UFC fight.  It wasn&#8217;t nearly as barbaric as I had expected, and I honestly enjoyed it a lot.  I may have to start attending the UFC-watching gatherings that those guys have from time to time.</p>
<p>My Mercurial session went pretty well, I think.  Based on the feedback, it definitely needs some polish in places, but I have a little bit of time to do that before I give it again at the <a href="http://nwacodecamp.org/">Northwest Arkansas Code Camp</a> and <a href="http://www.houstontechfest.com">Houston Tech Fest</a>.  If anybody who attended my session would like the slide deck, you can find it on my BitBucket account <a href="http://bitbucket.org/bmsullivan/mercurialpresentation/">here</a>.</p>
<p>All in all, it was definitely worth the trip up to Nashville, and I hope to make it back next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/08/12/devlink-retrospective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking in August</title>
		<link>http://www.sullivansoftdev.com/blog/2010/08/01/speaking-in-august/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/08/01/speaking-in-august/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 18:27:04 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=225</guid>
		<description><![CDATA[This month, I&#8217;m speaking at not one, but two conferences! The first will be DevLink, next week on the 5th thru the 7th in Nashville, TN.  I&#8217;ll be giving a presentation on &#8220;Distributed Version Control with Mercurial&#8221;.  I&#8217;m looking forward to catching up with a bunch of friends who are planning to attend.  If you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>This month, I&#8217;m speaking at not one, but two conferences!</p>
<p>The first will be <a href="http://www.devlink.net">DevLink</a>, next week on the 5th thru the 7th in Nashville, TN.  I&#8217;ll be giving a presentation on &#8220;Distributed Version Control with Mercurial&#8221;.  I&#8217;m looking forward to catching up with a bunch of friends who are planning to attend.  If you&#8217;re going to be there, come see my session at 11:30 on Saturday!</p>
<p>The next one will be <a href="http://www.sqlsaturday.com/28/eventhome.aspx">SQL Saturday</a> in Baton Rouge on the 14th, where I&#8217;ll be giving my &#8220;Introduction to NHibernate and Fluent NHibernate&#8221; presentation again at 2:45.  I&#8217;ve done that one so many times lately, I think I could just about do it in my sleep at this point.  ;-)</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/08/01/speaking-in-august/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using PowerShell to Ease the Pain of Branch-per-feature in Web Applications</title>
		<link>http://www.sullivansoftdev.com/blog/2010/05/10/using-powershell-to-ease-the-pain-of-branch-per-feature-in-web-applications/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/05/10/using-powershell-to-ease-the-pain-of-branch-per-feature-in-web-applications/#comments</comments>
		<pubDate>Tue, 11 May 2010 01:43:42 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=218</guid>
		<description><![CDATA[I’m currently using Mercurial for source control at work, and I absolutely love it.  I love the cheap branching, fast operations, and merging that actually works.  One of the side effects of using a branch-per-feature workflow in Mercurial is that you’re constantly creating new copies of your project structure in the file system.  Unlike Git, [...]]]></description>
			<content:encoded><![CDATA[<p>I’m currently using Mercurial for source control at work, and I absolutely love it.  I love the cheap branching, fast operations, and merging that actually <em>works</em>.  One of the side effects of using a branch-per-feature workflow in Mercurial is that you’re constantly creating new copies of your project structure in the file system.  Unlike Git, where the guidance is to create branches within one working copy of the repository and switch between them, the Mercurial community recommends creating full clones instead.</p>
<p>Even when doing development work, I like to use IIS for serving my web applications rather than the Visual Studio web server (Cassini), so my development environment is as close to production as possible.  I’ve gotten bitten a couple of times when transitioning from Cassini during development to IIS in production, so I decided to just use IIS from the start.</p>
<p>Using these technologies in combination, I started to run into a problem.  Every time I created a clone of my web app’s repository, I had to set up the directory as an IIS application, plus add the permissions required for IIS to read static files (and in my case, write to a temp images directory, since I’m using the Microsoft charting tool).  To make this process easier, I whipped up a couple of PowerShell scripts to take care of all those tasks in one fell swoop.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;">   1:</span> <span style="color: #008000;"># New-App.ps1</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;">   2:</span> <span style="color: #008000;"># usage: New-App "VirtualDirectoryName"</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;">   3:</span> <span style="color: #0000ff;">param</span>([string]$appName = <span style="color: #006080;">"appName"</span>)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;">   4:</span> $path = $pwd.Path</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;">   5:</span> $fullAppName = 'IIS:\Sites\Default Web Site\' + $appName</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;">   6:</span> pushd</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;">   7:</span> cd iis:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;">   8:</span> ni $fullAppName -physicalPath $path -type Application</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;">   9:</span> cd c:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;">  10:</span> popd</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;">  11:</span> $acl = Get-Acl $pwd.Path</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;">  12:</span> $inherit = [system.security.accesscontrol.InheritanceFlags]<span style="color: #006080;">"ContainerInherit, ObjectInherit"</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;">  13:</span> $propagation = [system.security.accesscontrol.PropagationFlags]<span style="color: #006080;">"None"</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;">  14:</span> $arIUSR = New-Object system.security.AccessControl.FileSystemAccessRule(<span style="color: #006080;">"IUSR"</span>, <span style="color: #006080;">"FullControl"</span>, $inherit, $propagation, <span style="color: #006080;">"Allow"</span>)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;">  15:</span> $arIISIUSRS = New-Object system.security.AccessControl.FileSystemAccessRule(<span style="color: #006080;">"IIS_IUSRS"</span>, <span style="color: #006080;">"FullControl"</span>, $inherit, $propagation, <span style="color: #006080;">"Allow"</span>)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;">  16:</span> $acl.SetAccessRule($arIUSR)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;">  17:</span> $acl.SetAccessRule($arIISIUSRS)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060;">  18:</span> Set-Acl $pwd.Path $acl</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>A couple of things about this one. A few things are hard-coded, like the site name (this will probably be “Default Web Site” on your machine, too unless you’re running a server OS) and the “FullControl” access, which can be changed to whatever minimum level of access you need the IIS accounts to have, like “Read” or “ReadAndExecute”.</p>
<p>I wish there was an easier way to set the permissions on the directory, but the System.Security .NET API was the only way that I found.  I’ve always felt that calling .NET code from PowerShell was a little bit kludgey, but I’m glad it’s at least possible to fill in the gaps in functionality.</p>
<p>In order to not leave an orphaned IIS virtual directory when I’m done with a branch, I use this script, which will search for the app by the physical path. This one could be fleshed out a little more.  It assumes that the virtual directory exists at the root of the default web site, and that you’re executing the script from the directory itself.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;">   1:</span> <span style="color: #008000;">#Remove-App.ps1</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;">   2:</span> $path = $pwd.Path</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;">   3:</span> pushd</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;">   4:</span> cd iis:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;">   5:</span> cd <span style="color: #006080;">'IIS:\sites\Default Web Site'</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;">   6:</span> $site = ls | Where-Object {$_.PhysicalPath <span style="color: #cc6633;">-eq</span> $path}</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;">   7:</span> ri $site.Name</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;">   8:</span> cd c:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;">   9:</span> popd</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>One more note: you&#8217;ll need to import the &#8220;WebAdministration&#8221; PowerShell module to get this to work. If you&#8217;re on Windows 7 and you&#8217;ve got PowerShell docked on your task bar, you can just right click and choose &#8220;Import System Modules&#8221;, the web admin module (along with a few others) will be imported into your PS session.  Otherwise, you can execute &#8220;Import-Module WebAdministration&#8221; at the PowerShell prompt or in your profile script.</p>
<p>Hope this helps somebody!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/05/10/using-powershell-to-ease-the-pain-of-branch-per-feature-in-web-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customer-Specific Behaviors in a Multi-Tenant Web Application Using Windsor</title>
		<link>http://www.sullivansoftdev.com/blog/2010/03/20/customer-specific-behaviors-in-a-multi-tenant-web-application-using-windsor/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/03/20/customer-specific-behaviors-in-a-multi-tenant-web-application-using-windsor/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 04:13:57 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=194</guid>
		<description><![CDATA[The main application that I work on is a multi-tennant web application, and we&#8217;ve always struggled a bit with the best way to separate the different behaviors and features required by the different customers who use our application.  Right now, it&#8217;s accomplished by a mixture of database lookups, subclasses, and the dreaded switch statement. Lately, [...]]]></description>
			<content:encoded><![CDATA[<p>The main application that I work on is a multi-tennant web application, and we&#8217;ve always struggled a bit with the best way to separate the different behaviors and features required by the different customers who use our application.  Right now, it&#8217;s accomplished by a mixture of database lookups, subclasses, and the dreaded switch statement.</p>
<p>Lately, I&#8217;ve been working on a proof of concept for a new architecture.  We&#8217;re introducing several new things, including the Windsor inversion of control container.  After working with it a little bit and starting to get my mind around the benefits of leaving the responsibility of object construction to the container, I started to think that there must be a way to use the container to separate customer-specific behavior into different implementations of the same interface.  That way customers&#8217; rules would be nicely isolated and easy to find.  In order to do that I needed to find a way to inject a particular interface implementation based on a run-time value, in my case the organization to which the logged-on user belongs.</p>
<p>After quite a bit Googling, I finally came across <a href="http://ayende.com/Blog/archive/2008/10/05/windsor-ihandlerselector.aspx">this post</a> by Ayende Rahien.  The IHandlerSelector was exactly what I was looking for.  It works like this:  each time an object is constructed, Windsor calls the HasOpinionAbout method on each of the handler selectors you&#8217;ve defined, where you can determine based on the interface that&#8217;s being requested whether you want to decide yourself which implementation to use.  If you decide that you do, Windsor will call the SelectHandler method of your handler selector, giving you a full list of all the implementations of the interface that&#8217;s being requested that are registered with the container.  Based on whatever logic you want, you just return one of those implementations.</p>
<p>It&#8217;s a bit more clear with a concrete example.  One of the core concepts in my application is the inspection of certain kinds of machinery.  However, each organization that uses the application has different rules and processes around inspections.  So, I&#8217;ll define an interface called IInspectionService, and have an implementation per customer.  Let&#8217;s say we have two customers that use the app, Acme and ServiceCo (note: totally made-up business names).</p>
<p><script src="http://gist.github.com/317884.js?file=IInspectionService.cs"></script> <script src="http://gist.github.com/317911.js?file=ServiceCoInspectionService.cs"></script></p>
<p><script src="http://gist.github.com/317911.js?file=AcmeInspectionService.cs"></script> Now that we&#8217;ve got those defined, we need to register the interface and implementations with the container, then define our IHandlerSelector.  As with any IoC registration, you&#8217;ll want to do this just once, as your application is starting (the simplest way is to do it inside the Global.ascx.cs of your web app).  <script src="http://gist.github.com/339054.js?file=IHandlerSelector+registration"></script></p>
<p><script src="http://gist.github.com/339055.js?file=InspectionHandlerSelector.cs"></script> The implementation of IHandlerSelector needs a bit of explaining.  Whenever the container is about to create an instance of anything, it will call the HasOpinionAbout method on all IHandlerSelectors that you&#8217;ve registered.  The container&#8217;s basically asking, &#8220;Do you want to get directly involved in choosing which implementation to use?&#8221;  In our case, we only want to get our hands in there if the container is trying to select some implementation of our IInspectionService, so we return &#8220;true&#8221; from HasOpinionAbout if that&#8217;s the case.</p>
<p>If HasOpinionAbout returns &#8220;true&#8221; for an IHandlerSelector, the container will then call that IHandlerSelector&#8217;s implementation of SelectHandler.  The key parameter to that method is the third one, the array of IHandlers.  All the implementations that could possibly satisfy the interface in question (IInspectionService in this case) that have been registered with the container will be inside that array, you just have to pick the one you want to use, using any arbitrary criteria you like.  Since we&#8217;re talking about this in the context of a multi-tenant system, I based the decision here on the group that the currently logged-on user belongs to.</p>
<p>So what does this all this IoC stuff get us?  Well, it particularly shines in an ASP.NET MVC application, where you can have the IoC container take control of creating your controllers, and thusly specify all of your controllers&#8217; dependencies in their constructors.  When you do that in combination with an IHandlerSelector, you completely remove all the messy &#8220;if&#8230;then&#8221; code related to different customers from your controller action methods.    <script src="http://gist.github.com/339069.js?file=InspectionController.cs"></script></p>
<p>In the code above, when the container creates the InspectionController, it will use our IHandlerSelector to pick the appropriate implementation of IInspectionService to pass in to the controller&#8217;s constructor.  So, if a customer from Acme is signed in, _inspectionService will be an AcmeInspectionService, and if a customer from Service Co. is logged in, _inspectionService will be a ServiceCoInspectionService.</p>
<p>I think this is a great way to segregate customer-specific logic.  It&#8217;s all in one class per customer, and doesn&#8217;t clutter up the entirety of your application.  You could also have a base class with operations that needed to happen regardless  of the customer to reduce duplication if needed.</p>
<p>I hope this is useful to somebody!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/03/20/customer-specific-behaviors-in-a-multi-tenant-web-application-using-windsor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My First &#8220;Speaking Tour&#8221;</title>
		<link>http://www.sullivansoftdev.com/blog/2010/03/11/my-first-speaking-tour/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/03/11/my-first-speaking-tour/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 03:56:04 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=205</guid>
		<description><![CDATA[I took a trip up to northwest Arkansas earlier this week to speak to several different .NET User Groups in the area about NHibernate.  On Monday evening, I spoke at my user group &#8220;alma mater&#8221;, the Fort Smith .NET User Group.  It was great to see a bunch of my old friends from Data-Tronics, including [...]]]></description>
			<content:encoded><![CDATA[<p>I took a trip up to northwest Arkansas earlier this week to speak to several different .NET User Groups in the area about NHibernate.  On Monday evening, I spoke at my user group &#8220;alma mater&#8221;, the <a href="http://www.fsdnug.org">Fort Smith .NET User Group</a>.  It was great to see a bunch of my old friends from Data-Tronics, including group president <a href="http://www.mohundro.com/blog/">David Mohundro</a>.</p>
<p>The next day, I was quite busy.  I met <a href="http://twitter.com/robbygregory">Robby Gregory</a> and a few other Wal-Mart employees for lunch, and at 1:30 I spoke at the Wal-Mart internal .NET User Group.  I then moved on to the Tyson internal user group (known as &#8220;DevLoop&#8221;) at 4:00, and directly on from there to the <a href="http://nwadnug.org/">Northwest Arkansas .NET User Group</a> at 6:00.  I enjoyed hanging out with <a href="http://jaysmith.us">Jay</a>, <a href="http://letsblogabout.net/">John</a>, <a href="http://devlinliles.com/">Devlin</a>, <a href="http://www.mpaladino.com/">Michael</a>, and several others at Jose&#8217;s afterwards, but by that time I was pretty beat.</p>
<p>I&#8217;m really glad that I&#8217;m getting to start speaking more (big thanks to my new employer Falcon Applications for letting me keep the dates only a week after I started the job!).  I&#8217;ve submitted a session for the <a href="http://dallastechfest.com/">Dallas TechFest</a>, plan to submit one or two for <a href="http://www.devlink.net/">DevLink</a>, and will continue to try to speak at other user groups later this year, as well.  Looks like I&#8217;m well on track to meeting at least one of my <a href="http://www.sullivansoftdev.com/blog/2010/01/07/a-plan-for-2010/">goals</a> for 2010!</p>
<p>Thanks to all the user group leaders who invited me up; I hope to be able to visit again some time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/03/11/my-first-speaking-tour/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I Love Lucy</title>
		<link>http://www.sullivansoftdev.com/blog/2010/02/24/i-love-lucy/</link>
		<comments>http://www.sullivansoftdev.com/blog/2010/02/24/i-love-lucy/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 05:13:38 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sullivansoftdev.com/blog/?p=197</guid>
		<description><![CDATA[This past Friday, the Sullivan family got a little bit bigger. Mom and baby are both doing fine.  I have to say, at least from the daddy perspective, the prior experience definitely helps.  I feel like things are going much easier than they did with our first daughter, Molly.  We&#8217;re still getting quite a bit [...]]]></description>
			<content:encoded><![CDATA[<p>This past Friday, the Sullivan family got a little bit bigger.</p>
<div id="attachment_198" class="wp-caption alignnone" style="width: 235px"><a href="http://www.sullivansoftdev.com/blog/wp-content/uploads/2010/02/photo-1.jpg"><img class="size-medium wp-image-198" title="Lucy's Eyes" src="http://www.sullivansoftdev.com/blog/wp-content/uploads/2010/02/photo-1-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">Lucy Sullivan</p></div>
<p>Mom and baby are both doing fine.  I have to say, at least from the daddy perspective, the prior experience definitely helps.  I feel like things are going much easier than they did with our first daughter, Molly.  We&#8217;re still getting quite a bit less sleep than normal, but there aren&#8217;t as many unknowns, and we don&#8217;t get stressed out about everything the way we did the first time.</p>
<p>And Lucy herself has been making it pretty easy; she&#8217;s a champion sleeper, just like her daddy!</p>
<p>Needless to say, blogging has taken kind of a back seat, but I hope to start back up again soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sullivansoftdev.com/blog/2010/02/24/i-love-lucy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

