<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Third Shelf</title>
	<atom:link href="http://thirdshelf.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thirdshelf.com</link>
	<description></description>
	<lastBuildDate>Mon, 12 Jul 2010 15:15:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thirdshelf.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/44066f6ef23f534426cca03dfdb5b95c?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Third Shelf</title>
		<link>http://thirdshelf.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thirdshelf.com/osd.xml" title="Third Shelf" />
	<atom:link rel='hub' href='http://thirdshelf.com/?pushpress=hub'/>
		<item>
		<title>Resizing a virtual hard disk</title>
		<link>http://thirdshelf.com/2010/06/29/resizing-a-vhd/</link>
		<comments>http://thirdshelf.com/2010/06/29/resizing-a-vhd/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 16:00:07 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=420</guid>
		<description><![CDATA[Recently, I had to resize a VHD (virtual hard disk) that I installed Windows Server 2008 on. I soon found out that the size of 10GB is not such a hot idea when installing Team Foundation Server 2010 and SQL Server 2008 on the same instance. Hence, I decided to resize the disk instead of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=420&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, I had to resize a <a href="http://en.wikipedia.org/wiki/VHD_%28file_format%29">VHD (virtual hard disk)</a> that I installed Windows Server 2008 on. I soon found out that the size of 10GB is not such a hot idea when installing Team Foundation Server 2010 and SQL Server 2008 on the same instance. Hence, I decided to resize the disk instead of re-installing all of the software.</p>
<p>Below is the recipe to resize the virtual hard disk:</p>
<p><strong>Part 1:</strong></p>
<p>The first part is to resize the container of the partition, which is done by means of a sector copy. After the resize completed,  the container will have increased but the partition will not be fully extended yet.<a href="http://thirdshelf.files.wordpress.com/2010/06/vhdresizer.png"><img class="size-medium wp-image-440  alignright" title="VhdResizer" src="http://thirdshelf.files.wordpress.com/2010/06/vhdresizer.png?w=300&#038;h=276" alt="" width="300" height="276" /></a></p>
<ol>
<li>Download <a href="http://vmtoolkit.com/files/folders/converters/entry87.aspx">VHD Resizer</a> from <a href="http://vmtoolkit.com">VMToolkit</a>.</li>
<li>Install and run VHD Resizer.</li>
<li>In the <strong>file open dialog</strong> select the VHD that you want to resize.</li>
<li>Type in the new filename to use for the extended VHD.</li>
<li>Type in the size of the new container to create.</li>
<li>Click on <strong>Resize</strong>. The process takes a few minutes&#8230;</li>
</ol>
<p><strong>Part 2:</strong></p>
<p style="text-align:left;">Now that the container is resized, we must now extend the partition to make use of the full container size.</p>
<ol>
<li><strong>Attach</strong> the new extended VHD as a <strong>non-primary drive</strong> to <em>another<strong> </strong></em>virtual machine. <em>Do not extend the partition using the virtual machine that will make use of it.</em></li>
<li>Start the virtual machine to which the extended VHD was attached as the non-primary drive and <strong>open</strong> a <strong>command prompt</strong>.</li>
<li>Type in <strong>diskpart</strong> and press <strong>Enter</strong>.</li>
<li>Type in <strong>list disk.</strong></li>
<li>Ensure that disk 1 or greater is the extended disk.</li>
<li>Type in <strong>select disk 1</strong>.</li>
<li>Type in <strong>list partition</strong>.<a href="http://thirdshelf.files.wordpress.com/2010/06/diskpart.png"><img class="size-medium wp-image-439  alignright" title="diskpart" src="http://thirdshelf.files.wordpress.com/2010/06/diskpart.png?w=300&#038;h=162" alt="" width="300" height="162" /></a></li>
<li>Ensure that the partition sizes matches the old size.</li>
<li>Type in <strong>extend</strong>.</li>
<li>Wait for the process to complete and type <strong>exit</strong>.</li>
</ol>
<p><em>Remember to change the disk on the original virtual machine to now use the extended disk.</em> The disk is now resized and ready to be used from the original virtual machine.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/420/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/420/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/420/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=420&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/06/29/resizing-a-vhd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/06/vhdresizer.png?w=300" medium="image">
			<media:title type="html">VhdResizer</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/06/diskpart.png?w=300" medium="image">
			<media:title type="html">diskpart</media:title>
		</media:content>
	</item>
		<item>
		<title>Sinking your interview before it starts</title>
		<link>http://thirdshelf.com/2010/06/20/sinking-your-interview-before-it-starts/</link>
		<comments>http://thirdshelf.com/2010/06/20/sinking-your-interview-before-it-starts/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 18:18:15 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[management]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=418</guid>
		<description><![CDATA[During a series of interviews I discovered some things about reading CV&#8217;s that downright irritate me. I share them here with you just in case your interviewer is anything like me :). Keep it short and to the point. CV&#8217;s that span more than four pages is too long. I had the displeasure of reading [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=418&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_426" class="wp-caption alignright" style="width: 310px"><a href="http://thirdshelf.files.wordpress.com/2010/06/old_shipwreck_stock_by_fairiegoodmother.jpg"><img class="size-medium wp-image-426" title="Old_Shipwreck_Stock_by_Fairiegoodmother" src="http://thirdshelf.files.wordpress.com/2010/06/old_shipwreck_stock_by_fairiegoodmother.jpg?w=300&#038;h=224" alt="" width="300" height="224" /></a><p class="wp-caption-text">Photo credit http://fairiegoodmother.deviantart.com/</p></div>
<p>During a series of interviews I discovered some things about reading CV&#8217;s that downright irritate me. I share them here with you just in case your interviewer is anything like me :).</p>
<ul>
<li><strong>Keep it short and to the point. </strong> CV&#8217;s that span more than four pages is too long. I had the displeasure of reading a CV of seventeen pages. That makes me unhappy. Your interviewer simply does not have the time to read your entire life story.</li>
<li>Observe the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY (Don&#8217;t repeat yourself) principle</a> in your CV. <strong>Do not repeat</strong> the fact that you have a degree three times.</li>
<li><strong>Keep the details relevant</strong>. I want a programmer. I&#8217;m not interested in the fact that you are a landlord or that you are the chairperson of your body corporate.</li>
<li>If you have been between jobs frequently and they have been <strong>contract based</strong>, make sure you <strong>state it clearly</strong>.</li>
<li>Check and check again for <strong>spelling mistakes</strong>. There is nothing more annoying than spelling mistakes in a CV.</li>
</ul>
<p>If you are working through a recruitment agency, <strong>insist on reviewing your CV</strong> before they send it out. Often the candidate will send the recruitment agency a two page CV and then they will apply power word magic and out comes a CV of seventeen pages. Recruitment agents also tend to embellish CV&#8217;s. This is the worst mistake they can make as it will paint this picture-perfect image of you that might not match up to the reality when you are interviewed.</p>
<p>Skills matrices are my absolute favorite. Rating yourself an expert in C# will make me raise an eyebrow if your name is not <a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg">Anders Hejlsberg</a> or <a href="http://blogs.msdn.com/b/ericlippert/">Eric Lippert</a>. Call yourself an expert if you can almost recite the <a href="http://msdn.microsoft.com/en-us/netframework/aa569283.aspx">ECMA specifications</a> off by heart.</p>
<p><strong>How to sink yourself in the interview</strong></p>
<p>Sinking your interview isn&#8217;t all that hard. When answering questions in an interview, remember that there is a time to shut up. Ten minutes to answer a question is too long. Lookout for the interviewers glazed stare. That is a sign that you have crossed the shut-up-already limit a couple of miles ago.</p>
<p>Remember that you don&#8217;t know the people that are interviewing you. They have their opinions and stances and you can offend them in no time. Always keep this in mind.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/418/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=418&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/06/20/sinking-your-interview-before-it-starts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/06/old_shipwreck_stock_by_fairiegoodmother.jpg?w=300" medium="image">
			<media:title type="html">Old_Shipwreck_Stock_by_Fairiegoodmother</media:title>
		</media:content>
	</item>
		<item>
		<title>Programming pragmatically</title>
		<link>http://thirdshelf.com/2010/06/13/programming-pragmatically/</link>
		<comments>http://thirdshelf.com/2010/06/13/programming-pragmatically/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 16:29:48 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[dont-program-if]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=382</guid>
		<description><![CDATA[Don&#8217;t program if&#8230; you have not yet read The Pragmatic Programmer: From Journeyman to Master by Andy Hunt and David Thomas. I never understood what all the fuss was about and here I am making a fuss about it. pragmatic 1540s, from M.Fr. pragmatique , from L. pragmaticus  &#8221;skilled in business or law,&#8221; from Gk. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=382&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t program if&#8230; you have not yet read <a href="http://www.amazon.com/gp/product/020161622X?ie=UTF8&amp;tag=thethishe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=020161622X">The Pragmatic Programmer: From Journeyman to Master</a> by <a href="http://blog.toolshed.com">Andy Hunt</a> and <a href="http://pragdave.pragprog.com/">David Thomas</a>. I never understood what all the fuss was about and here I am making a fuss about it.</p>
<blockquote><p><strong>pragmatic</strong> 1540s,  from  M.Fr.  pragmatique  , from  L.  pragmaticus   &#8221;skilled  in  business  or  law,&#8221;  from  Gk.  pragmatikos   &#8221;versed  in  business,&#8221;  from  pragma   (gen.  pragmatos  ) &#8220;civil  business,  deed,  act,&#8221;  from  prassein   &#8221;to  do,  act,  perform.&#8221; (1)</p></blockquote>
<p><strong>Pragmatic programmer</strong></p>
<p>So, what makes a pragmatic programmer? A pragmatic programmer is someone who exhibits certain attitudes and practices when thinking, writing, testing and deploying software. This includes being an early adopter or fast adapter, being inquisitive and thinking critically. It also means being realistic and being <a href="http://thelimberlambda.com/2010/05/25/the-skill-to-learn/">anything-ready</a>. And to be anything -ready one must learn continuously.</p>
<p>One of the major philosophies is to always place the problem and the solution in a larger context. This means to always think beyond the immediate problem and see the bigger picture. Why? Simply, so that you can make <em>informed decisions</em> such as deciding where to comprise and where to apply the <a href="http://en.wikipedia.org/wiki/80-20_rule">Pareto principle</a>.</p>
<p>A pragmatic programmer takes responsibility for everything they do. They don&#8217;t just sit there and watch the code rot. A pragmatic programmer will always endeavor to keep the code pristine.</p>
<p>Instigating change is another important skill that a pragmatic programmer must learn to apply. People are naturally opposed to change and in order to be a pragmatic in a software project, it is sometimes necessary to break the &#8220;we have always done it like this&#8221; mentality.</p>
<p><strong>Skills and Tools</strong></p>
<p>Using the appropriate tools is one of the best ways to amplify your productivity. Try <a href="http://www.hanselman.com/tools">various tools</a> and pick the ones that work for you. Then, learn them extremely well. Mold them to the shape of your hand. Consider the following categories of tools:</p>
<ul>
<li>Source control</li>
<li>Text manipulation</li>
<li>Debugging</li>
</ul>
<p>Another important tool is to be able to <a href="http://www.codinghorror.com/blog/2008/11/we-are-typists-first-programmers-second.html">touch type</a>. This is a worthwhile skill to<a href="http://www.keybr.com"> learn</a>, so be prepared to put in a lot of time.</p>
<p><strong>Life as a pragmatic programmer</strong></p>
<p>Being a pragmatic programmer does not make you write perfect programs. Accept it. Things will go wrong and when they do, we should ensure that the data always remain consistent. As the book says &#8220;dead programs tell no lies&#8221; and sometimes it is best to just simply kill it.</p>
<p>As long as there are people, software will change, continuously. That&#8217;s life. Pragmatic programmers guard themselves against the impact of these changes by observing the <a href="http://en.wikipedia.org/wiki/Law_Of_Demeter">Law of Demeter</a> (<a href="http://haacked.com/archive/2009/07/14/law-of-demeter-dot-counting.aspx">it&#8217;s not a dot counting exercise</a>) and decoupling dependencies. Keep separate concepts separate.</p>
<p>Coding is not just a matter of transcribing requirements into source code. It is a continuous process of making decisions. Decisions that will either pave your way or cause you grief later on. The choice is yours. Think critically about every line of code and remember to refactor continuously. Test, test and test some more.</p>
<p>While building software, there are two important principles that a  pragmatic programmer always observes. These are avoiding duplication at  all costs and avoid splitting a piece of knowledge across multiple  components. Failing to observe these two principles will invariably  bring you headaches in the future as the source code spirals out of  control.</p>
<p>This is the way of the pragmatic programmer.</p>
<p>By the way, there are loads of <a href="http://www.codinghorror.com/blog/files/Pragmatic%20Quick%20Reference.htm">tips</a> in the book that will not only benefit you now, but for as long you write   code.</p>
<p>(1) Dictionary.com, &#8220;pragmatic,&#8221; in <em>Online Etymology Dictionary</em>.  Source location: Douglas Harper, Historian. <a href="http://dictionary.reference.com/browse/pragmatic" target="_parent">http://dictionary.reference.com/browse/pragmatic</a>.  Available: <a href="http://dictionary.reference.com/" target="_parent">http://dictionary.reference.com</a>.  Accessed: June 13, 2010.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/382/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=382&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/06/13/programming-pragmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>
	</item>
		<item>
		<title>Mocking multiple interfaces using Rhino Mocks</title>
		<link>http://thirdshelf.com/2010/06/06/mocking-multiple-interfaces-using-rhino-mocks/</link>
		<comments>http://thirdshelf.com/2010/06/06/mocking-multiple-interfaces-using-rhino-mocks/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 18:03:00 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[rhino-mocks]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=393</guid>
		<description><![CDATA[A while back on StackOverflow I asked a question on how to create a mock object with Rhino Mocks that implements multiple interfaces. In other words, I want to generate a mock that implements more than one interface. This baffled me for a while and I was shown the light by one of my colleagues. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=393&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>A while back on StackOverflow I <a href="http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type">asked a question</a> on how to create a <a href="http://en.wikipedia.org/wiki/Mock_object">mock object</a> with <a href="http://www.ayende.com/projects/rhino-mocks.aspx">Rhino Mocks</a> that implements multiple interfaces. In other words, I want to generate a mock that implements more than one interface. This baffled me for a while and I was shown the light by one of my colleagues.</p>
<p>A multi-mock is created like so:</p>
<pre class="brush: csharp;">
var mocker = new MockRepository();
var mock = mocker.CreateMultiMock&lt;IPrimaryInterface&gt;(typeof(IFoo), typeof(IBar));
mock.Expect(x =&gt; x.AnswerToUniverse()).Return(42);
mocker.ReplayAll();
</pre>
<p>Note the call to ReplayAll. Without this call the mock will not be setup with the intended values.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=393&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/06/06/mocking-multiple-interfaces-using-rhino-mocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit test deployment issue when file is untrusted</title>
		<link>http://thirdshelf.com/2010/04/05/unit-test-deployment-issue-when-file-is-untrusted/</link>
		<comments>http://thirdshelf.com/2010/04/05/unit-test-deployment-issue-when-file-is-untrusted/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 15:12:52 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[visual studio]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=369</guid>
		<description><![CDATA[Recently, I decided to use NHibernate in a project so that I could achieve database affinity. That provided me with another benefit and that was the ability to create a database in-memory for testing purposes. Sounded great, but while trying to run the unit tests using MsTest and SQLite, I received the following error: &#8220;Test [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=369&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, I decided to use <a href="http://www.nhforge.net">NHibernate</a> in a project so that I could achieve database affinity. That provided me with another benefit and that was the ability to create a <a href="http://ayende.com/Blog/archive/2006/10/14/UnitTestingWithNHibernateActiveRecord.aspx">database in-memory</a> for testing purposes. Sounded great, but while trying to run the unit tests using <a href="http://en.wikipedia.org/wiki/MSTest">MsTest</a> and <a href="http://sqlite.org/">SQLite</a>, I received the following error: &#8220;<em>Test Run deployment issue: The location of the file or directory &#8216;C:\projects\myproject\SQLite\sqlite3.dll&#8217; is not trusted.</em>&#8220;.</p>
<p>That problem was easily solved by simply unblocking the file. Below are the steps on how to unblock the file:</p>
<ol>
<li>Right-click the blocked file (sqlite3.dll), and then click 				<strong>Properties</strong>.</li>
<li>This will open the properties dialog:</li>
<p><a href="http://thirdshelf.files.wordpress.com/2010/04/unblockpropertiesdialog.png"><img title="UnblockPropertiesDialog" src="http://thirdshelf.files.wordpress.com/2010/04/unblockpropertiesdialog.png?w=377&#038;h=515" alt="" width="377" height="515" /></a></p>
<li>In the <strong>General</strong> tab, click 				<strong>Unblock</strong>.</li>
<li>Click on <strong>OK</strong>.</li>
</ol>
<p>That&#8217;s it, the file is now trusted and the runtime should be able to load the file successfully.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=369&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/04/05/unit-test-deployment-issue-when-file-is-untrusted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/04/unblockpropertiesdialog.png" medium="image">
			<media:title type="html">UnblockPropertiesDialog</media:title>
		</media:content>
	</item>
		<item>
		<title>Kindle review</title>
		<link>http://thirdshelf.com/2010/03/22/kindle-review/</link>
		<comments>http://thirdshelf.com/2010/03/22/kindle-review/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 17:55:54 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[kindle]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=343</guid>
		<description><![CDATA[I finally took the plunge and purchased the Kindle 6&#8243; Global Wireless edition from Amazon. I simply couldn&#8217;t wait for it to arrive. Something akin to a 7 year old getting his first bicycle. Finally, the day arrived! Packaging The packaging was so impressive it is almost worth its own blog post &#8211; the attention to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=343&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">I finally took the plunge and purchased the <a href="http://www.amazon.com/gp/product/B0015T963C?ie=UTF8&amp;tag=thethishe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0015T963C">Kindle 6&#8243; Global Wireless edition</a><img style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.com/e/ir?t=thethishe-20&amp;l=as2&amp;o=1&amp;a=B0015T963C" border="0" alt="" width="1" height="1" /> from Amazon. I simply couldn&#8217;t wait for it to arrive. Something akin to a 7 year old  getting his first bicycle. Finally, the day arrived!</p>
<p style="text-align:left;"><strong>Packaging</strong></p>
<p style="text-align:left;"><a href="http://thirdshelf.files.wordpress.com/2010/03/kindleopeningstrip.jpg"><img class="alignleft size-medium wp-image-346" title="KindleOpeningStrip" src="http://thirdshelf.files.wordpress.com/2010/03/kindleopeningstrip.jpg?w=180&#038;h=134" alt="" width="180" height="134" /></a>The packaging was so impressive it is almost worth its own blog post &#8211; the attention to detail was outstanding.<a href="http://thirdshelf.files.wordpress.com/2010/03/kindlebarcode.jpg"><img class="alignright size-full wp-image-345" title="KindleBarCode" src="http://thirdshelf.files.wordpress.com/2010/03/kindlebarcode.jpg?w=314&#038;h=218" alt="" width="314" height="218" /></a> For example, how much attention do you pay to bar codes? Well, Amazon didn&#8217;t slip on bar code detail. Have a closer look and you&#8217;ll see that little man sitting under the tree reading his book&#8230;</p>
<p style="text-align:left;">The next interesting part is the &#8220;Certified frustration-free packaging&#8221; seal. That seal lives up to the promise. Opening the box is done with a peel-off strip. What a neat way to open the box. Again, Amazon had the detail going &#8211; the opening strip read &#8220;Once upon a time&#8230;&#8221;. Mission accomplished: frustration-free packaging.</p>
<p style="text-align:left;">
<p style="text-align:left;"><strong>Cover<br />
</strong></p>
<p style="text-align:left;"><strong><a href="http://thirdshelf.files.wordpress.com/2010/03/kindlecoveroutside.jpg"><img class="alignleft size-full wp-image-350" title="KindleCoverOutside" src="http://thirdshelf.files.wordpress.com/2010/03/kindlecoveroutside.jpg?w=215&#038;h=286" alt="" width="215" height="286" /></a> </strong>I decided to get the well-worth-it leather cover for the additional $31.99. At the bottom right there is a metal branding insert. Nice idea, although, I was a little disappointed with the top right hand corner as the leather wasn&#8217;t properly fitted around the plate. The stitching around the edges is very neat and the feel of the cover is luxurious.</p>
<p style="text-align:left;">Inside, it has a soft padded inner; front and back; that is essential to protect the screen from accidental bumps. Before I bought the cover, I was perplexed about how the device attaches to the cover. Maybe with elastic bands around each corner, I thought?! The website wasn&#8217;t too detailed about it and for the price of $31.99 I would expect it to be a decent cover with a proper attachment mechanism. And so it was. The attaching mechanism of the cover just simply blew me away. <a href="http://thirdshelf.files.wordpress.com/2010/03/kindlecoverinside.jpg"><img class="alignright size-medium wp-image-351" title="KindleCoverInside" src="http://thirdshelf.files.wordpress.com/2010/03/kindlecoverinside.jpg?w=300&#038;h=224" alt="" width="300" height="224" /></a>With only two ingenious hinges the cover and the device will have a hard time separating by itself. The bottom hinge slides into the device at an angle and the top hinge slides into the device. It has a spring action and releases when pulled downwards. So, the device attaches by sliding in the bottom hinge at an angle and secured by the top hinge. Ingenious.</p>
<p style="text-align:left;"><strong>Power adapter</strong></p>
<p style="text-align:left;">B<a href="http://thirdshelf.files.wordpress.com/2010/03/kindlepoweradapter.jpg"><img class="alignleft size-medium wp-image-356" title="KindlePowerAdapter" src="http://thirdshelf.files.wordpress.com/2010/03/kindlepoweradapter.jpg?w=240&#038;h=179" alt="" width="240" height="179" /></a>attery powered devices have this tendency to run down from time to time and needs to be charged every so often. Luckily the Kindle ships with more than one way to get this much needed charge. Firstly, there is charging by USB and secondly, charging by plugging into the mains. The latter is done with an American style two pin plug. Having ordered the global edition, it is a little unusual to find an American style plug in the packaging. With this in mind Amazon realized that this is not quite optimal and included another adapter that converts the American style to an European two pin style plug. Great, I live in South Africa where we have huge three pin plugs. Nothing that another adapter can&#8217;t fix. A downside is that the battery is not easily replaced, except by sending it in to Amazon. I suspect that this is by design. Annuity income?</p>
<p style="text-align:left;"><strong>The device</strong></p>
<p style="text-align:left;"><strong><a href="http://thirdshelf.files.wordpress.com/2010/03/kindle.jpg"><img class="alignright size-full wp-image-359" title="Kindle" src="http://thirdshelf.files.wordpress.com/2010/03/kindle.jpg?w=336&#038;h=448" alt="" width="336" height="448" /></a></strong>When taking the device out of the packaging, I was surprised that instructions were printed on the screen. How amazing to realize that <a href="http://en.wikipedia.org/wiki/E_Ink">E-Ink</a> doesn&#8217;t consume any power to display static  text or images. As can be seen in the photo, a random image is rendered on the display every time it is switched off.</p>
<p style="text-align:left;">I was pleasantly surprised at the quality of the display. It renders fonts with a very nice smooth precise <a href="http://en.wikipedia.org/wiki/Anti_alias">anti alias</a> effect. The display can be read from almost any angle. The downside is that it doesn&#8217;t have a back light and I hope that it will make an appearance in future editions. Although I can easily justify it by saying &#8220;you can&#8217;t read a book in the dark, can you?&#8221;. Another little annoying thing with the display is the &#8220;clearing&#8221; effect when paging. With e-ink, the reader first has to black the current page, clear the page and then render the text or image. However, this process is fairly quick on the Kindle and one gets used to the effect quickly.</p>
<p style="text-align:left;">In South Africa I was also surprised to find the 3G connection worked first time round without any hassles and automatically registered the Kindle at Amazon when the first connection was established.It seems to be making use of the Vodacom network. Using the 3G connection is weighs down on the battery and I would recommend using it only when necessary.</p>
<p style="text-align:left;">The buttons are perfectly placed on the device &#8211; when you are not using the cover. Using the left-hand buttons with the cover on is not user friendly. It is rather silly that the previous page-button is only on the left. Not a problem if you use the device without the cover. The five-way scroll button is perhaps a little on the small side but quite functional. Don&#8217;t expect to use the keyboard like an ordinary one. The buttons are tiny. Why is there a keyboard on Kindle?</p>
<p style="text-align:left;">When reading a book on the Kindle, you&#8217;ll be surprised to know that it comes with a dictionary that is automatically invoked when you scroll to a word and hover. Brilliant. You can do manual searches in the dictionary, make annotations on pages. Setting a bookmark on a page makes a little dog-ear shape appear in the top right-hand corner.</p>
<p style="text-align:left;"><a href="http://thirdshelf.files.wordpress.com/2010/03/kindleback1.jpg"><img class="alignleft size-full wp-image-366" title="KindleBack" src="http://thirdshelf.files.wordpress.com/2010/03/kindleback1.jpg?w=448&#038;h=336" alt="" width="448" height="336" /></a>Another surprise was the back of the device. It has a very neat brushed metal finish and makes it feel expensive. The serial number is printed at the bottom, in case you are wondering. Beside that the Kindle has built-in text-to-speech functionality which works brilliantly.</p>
<p style="text-align:left;">Loading your own PDF documents to the Kindle is a cinch. It mounts the same as a flash drive in Windows and books and PDF documents are copied to the documents folder. One thing that I found is that when plugging it into the USB port the device becomes &#8220;unusable&#8221; until you eject it from Windows. I have tried to eject it to get it usable while plugged in but with no success. Maybe it&#8217;s just me?</p>
<p style="text-align:left;">Being able to load PDF documents (from version 2.3) is great. Not being able to zoom them is not so great. I hope to see a zoom feature added to the PDF documents reader. The display can be rotated but the reader just doesn&#8217;t feel right being read in a rotated manner.</p>
<p style="text-align:left;">Shopping on the Kindle is great experience with custom layouts specially formatted for the Kindle. Beware that the quickest way to being broke is to enable the <em>Buy now with 1-Click</em> facility. It&#8217;s ease of use is addictive.</p>
<p style="text-align:left;">When reading a book the Kindle disappears once you get into the book. It&#8217;s a great reading device and at the price of $259 I strongly recommend it.</p>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=343&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/03/22/kindle-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>

		<media:content url="http://www.assoc-amazon.com/e/ir?t=thethishe-20&#38;l=as2&#38;o=1&#38;a=B0015T963C" medium="image" />

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindleopeningstrip.jpg?w=300" medium="image">
			<media:title type="html">KindleOpeningStrip</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindlebarcode.jpg" medium="image">
			<media:title type="html">KindleBarCode</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindlecoveroutside.jpg" medium="image">
			<media:title type="html">KindleCoverOutside</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindlecoverinside.jpg?w=300" medium="image">
			<media:title type="html">KindleCoverInside</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindlepoweradapter.jpg?w=300" medium="image">
			<media:title type="html">KindlePowerAdapter</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindle.jpg" medium="image">
			<media:title type="html">Kindle</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/kindleback1.jpg" medium="image">
			<media:title type="html">KindleBack</media:title>
		</media:content>
	</item>
		<item>
		<title>Automating a ClickOnce Deployment &#8211; Part3</title>
		<link>http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-part3/</link>
		<comments>http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-part3/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 18:34:33 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[team foundation server]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=320</guid>
		<description><![CDATA[Continuing the series on Automating a ClickOnce Deployment it’s time to implement the deployment scheme in a build file. After the build file compiled the solution we are ready to start the copying of the installation files to the deployment server. Before we start the copy process we have to create a new directory for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=320&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-%e2%80%93-part2/">Continuing  the series</a> on Automating a ClickOnce Deployment it’s time to implement the deployment scheme in a build file.</p>
<p>After the build file compiled the solution we are ready to start the copying of the installation files to the deployment server. Before we start the copy process we have to create a new directory for the new application version. In the following snippet I simply generate a new version number and then create a directory where we will copy the installation files to:</p>
<pre class="brush: xml;">
&lt;Target Name=&quot;DeployApplication&quot;&gt;
  &lt;Message Text=&quot;Deploying the client application to $(PublishServer)&quot; /&gt;
  &lt;MakeDir Directories=&quot;$(DeploymentServer)\Published\App\$(VersionNumber)&quot; /&gt;
</pre>
<p>We are ready to copy the application files to the server:</p>
<pre class="brush: xml;">
&lt;Message Text=&quot;Copying files to deployment directory [$(DeploymentServer)\Published\App\$(VersionNumber)]&quot; /&gt;
&lt;Copy DestinationFiles=&quot;@(ApplicationFiles-&gt;'$(DeploymentServer)\Published\App\$(VersionNumber)\%(Filename)%(Extension)')&quot; SourceFiles=&quot;@(ApplicationFiles-&gt;'$(BinariesFolder)\%(Filename)%(Extension)')&quot; /&gt;
</pre>
<p>The ApplicationFiles is an item group with the installation files that we are copying. <em>Note:</em> we do not transform the filename to include the .deploy extension because we first need to generate the deployment manifest with the files in the right location before changing the name of the files. (See Gotcha #3). Next, we create the application manifest with the <a href="http://msdn.microsoft.com/en-us/library/acz3y3te%28VS.80%29.aspx">Mage</a> utility which will be stored in the application directory (not in the version directory). Mage is a manifest generator and is used to generate both application and deployment manifests. In the snippet below we are using Mage explicitly to generate the application manifest:</p>
<pre class="brush: xml;">
&lt;CreateProperty Value=&quot;$(DeploymentServer)\Published\App\$(VersionNumber)\App.exe.manifest&quot;&gt;
  &lt;Output TaskParameter=&quot;Value&quot; PropertyName=&quot;ApplicationManifestFile&quot;/&gt;
&lt;/CreateProperty&gt;
&lt;Message Text=&quot;Generating application manifest  [$(ApplicationManifestFile)] using  [$(DeploymentServer)\Published\App\$(VersionNumber)]&quot; /&gt;
&lt;Exec Command=&quot;mage.exe -New  Application -p msil -TrustLevel FullTrust -ToFile  $(ApplicationManifestFile) -Name  &amp;quot;App&amp;quot; -Version $(VersionNumber) -FromDirectory  $(DeploymentServer)\Published\App\$(VersionNumber)&quot; /&gt;
</pre>
<p>So far so good, we have now managed to generate the deployment manifest from the files located in the &#8230;\Published\App directory and placed the file in the &#8230;\Published\App\$(VersionNumber) directory. We will now point the application manifest to this deployment manifest so that the correct files are installed on the client machine.</p>
<p>We now have everything that we need in order to generate the application manifest.</p>
<pre class="brush: xml;">
&lt;CreateItem Include=&quot;$(ApplicationManifestFile)&quot; AdditionalMetadata=&quot;TargetPath=$(VersionNumber)\App.exe.manifest&quot;&gt;
  &lt;Output TaskParameter=&quot;Include&quot; ItemName=&quot;RelativeApplicationManifestFile&quot;/&gt;
&lt;/CreateItem&gt;

&lt;GenerateDeploymentManifest AssemblyName=&quot;App.exe.application&quot;
  AssemblyVersion=&quot;$(VersionNumber)&quot;
  DeploymentUrl=&quot;http://deployment-server/Published/App/App.exe.application&quot;
  Product=&quot;App&quot;
  Description=&quot;App&quot;
  Publisher=&quot;thirdshelf.com&quot;
  Install=&quot;true&quot;
  UpdateEnabled=&quot;true&quot;
  UpdateMode=&quot;Foreground&quot;
  OutputManifest=&quot;$(DeploymentServer)\Published\App\App.exe.application&quot;
  MapFileExtensions=&quot;true&quot;
  EntryPoint=&quot;@(RelativeApplicationManifestFile)&quot; /&gt;
</pre>
<p>If you read <a href="http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-%e2%80%93-part2/">part 2</a> of this series you should be able to map these properties straight to their positions in the application manifest file and their functions. The only thing that remains is to rename the files to include their .deploy extensions. This can easily be done in the following way:</p>
<pre class="brush: xml;">
&lt;Message Text=&quot;Replacing files in [$(DeploymentServer)\Published\App\$(VersionNumber)\] with [.deploy]&quot; /&gt;
&lt;Delete Files=&quot;@(ApplicationFiles-&gt;'$(DeploymentServer)\Published\App\$(VersionNumber)\%(Filename)%(Extension)')&quot; /&gt;
&lt;Copy SourceFiles=&quot;@(ApplicationFiles-&gt;'$(BinariesFolder)\%(Filename)%(Extension)')
  DestinationFiles=&quot;@(ApplicationFiles-&gt;'$(DeploymentServer)\Published\App\$(VersionNumber)\%(Filename)%(Extension).deploy')&quot; /&gt;
</pre>
<p>Visiting the URL http://deployment-server/Published/App/App.exe.manifest and clicking on the Install button you should see the following dialog:</p>
<p><img class="aligncenter size-full wp-image-335" title="ClickOnceInstallingApplication" src="http://thirdshelf.files.wordpress.com/2010/03/clickonceinstallingapplication1.png?w=516&#038;h=292" alt="" width="516" height="292" /><strong>Gotchas</strong></p>
<p>There are a few gotchas that you might find on your way to success and I&#8217;ve listed the most common ones here and their solutions for your convenience:</p>
<p><strong>Gotcha #1:</strong> Reference in the manifest does not match the identity of the downloaded  assembly &#8230;</p>
<p>This is easily resolved by adding the NoWin32Manifest property to solution in the SolutionsToBuild group:</p>
<pre class="brush: xml;">
&lt;SolutionToBuild Include=&quot;$(SolutionRoot)\Application.sln&quot;&gt;
  &lt;Properties&gt;NoWin32Manifest=true&lt;/Properties&gt;
&lt;/SolutionToBuild&gt;
</pre>
<p><strong>Gotcha #2:</strong> XML files are marked as data files, by default.</p>
<p>This means that XML files are  published to the data directory whose location can found by querying the<code> </code>System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory  property.</p>
<p><strong>Gotcha #3: </strong>The customHostSpecified attribute is not supported for Windows Forms  applications.</p>
<p>Not a very helpful error, but chances are that you generated the deployment manifest with the installation files having the .deploy extension and not on the original filenames.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/320/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=320&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-part3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2010/03/clickonceinstallingapplication1.png" medium="image">
			<media:title type="html">ClickOnceInstallingApplication</media:title>
		</media:content>
	</item>
		<item>
		<title>Automating a ClickOnce Deployment – Part2</title>
		<link>http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-%e2%80%93-part2/</link>
		<comments>http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-%e2%80%93-part2/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 14:47:42 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[team foundation server]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=278</guid>
		<description><![CDATA[Continuing the series on Automating a ClickOnce Deployment it&#8217;s time to have a look at the manifest files. There are two required manifest files that give clickonce the necessary information to deploy the application: an application manifest (.application); a deployment manifest (.manifest). Application Manifest The application manifest describes the application that we are going to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=278&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://thirdshelf.com/2009/09/06/automating-clickonce-deployment/">Continuing the series</a> on Automating a ClickOnce Deployment it&#8217;s time to have a look at the manifest files. There are two required manifest files that give clickonce the necessary information to deploy the application:</p>
<ul>
<li>an application manifest (.application);</li>
<li>a deployment manifest (.manifest).</li>
</ul>
<p><strong>Application Manifest</strong></p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/ws1c2fch.aspx">application  manifest</a> describes the application that we are going to install. So, let&#8217;s have a look at the contents of this file:</p>
<pre class="brush: xml;">
xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;asmv1:assembly xsi:schemaLocation=&quot;urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd&quot; manifestVersion=&quot;1.0&quot; xmlns:asmv3=&quot;urn:schemas-microsoft-com:asm.v3&quot; xmlns:dsig=&quot;http://www.w3.org/2000/09/xmldsig#&quot; xmlns:co.v1=&quot;urn:schemas-microsoft-com:clickonce.v1&quot; xmlns=&quot;urn:schemas-microsoft-com:asm.v2&quot; xmlns:asmv1=&quot;urn:schemas-microsoft-com:asm.v1&quot; xmlns:asmv2=&quot;urn:schemas-microsoft-com:asm.v2&quot; xmlns:xrml=&quot;urn:mpeg:mpeg21:2003:01-REL-R-NS&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
  &lt;assemblyIdentity name=&quot;App.application&quot; version=&quot;1.0.903.18476&quot; publicKeyToken=&quot;0000000000000000&quot; language=&quot;neutral&quot; processorArchitecture=&quot;msil&quot; xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot; /&gt;
  asmv2:publisher=&quot;App Publishers Company&quot; asmv2:product=&quot;App&quot; xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot;&gt;App
  mapFileExtensions=&quot;true&quot;&gt;
    &lt;subscription&gt;
      &lt;update&gt;
        &lt;beforeApplicationStartup /&gt;
      &lt;/update&gt;
    &lt;/subscription&gt;
    &lt;deploymentProvider codebase=&quot;http://deployment-server/Published/App/app.exe.application&quot; /&gt;
  &lt;/deployment&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly dependencyType=&quot;install&quot; codebase=&quot;1.0.903.18476\App.exe.manifest&quot; size=&quot;33600&quot;&gt;
      &lt;assemblyIdentity name=&quot;App.exe&quot; version=&quot;1.0.903.18476&quot; publicKeyToken=&quot;0000000000000000&quot; language=&quot;neutral&quot; processorArchitecture=&quot;msil&quot; type=&quot;win32&quot; /&gt;
      &lt;hash&gt;
        &lt;dsig:Transforms&gt;
          &lt;dsig:Transform Algorithm=&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot; /&gt;
        &lt;/dsig:Transforms&gt;
        &lt;dsig:DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot; /&gt;
        &lt;dsig:DigestValue&gt;DrLiyVjtlKhOmtuzuXhFSTqi/9Q=
      &lt;/hash&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
&lt;/asmv1:assembly&gt;
</pre>
<p>One of the important things to note in this manifest is the <em>mapFileExtensions</em> attribute in the<em> deployment </em>tag. This attribute indicates that our installation files have a .deploy extension &#8211; MyApplication.exe is copied to the deployment server as MyApplication.exe.deploy and is renamed when installed on the client machine. In the <em>deploymentProvider</em> tag we specify where the application can find future updates and from where this application was installed.</p>
<p>The next interesting tag is <em>dependentAssembly, </em>which points to the deployment manifest to use when installing the application on the client machine. We specify the deployment manifest in the <em>codeBase</em> attribute which describes how the application installs. Note that the <em>codebase</em> attribute points to a version folder in which the deployment manifest resides &#8211; for every new release of the application this application manifest is either overwritten or updated to point to the new version of the installation files and deployment manifest.</p>
<p><strong>Deployment Manifest</strong></p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/k26e96zf.aspx">deployment manifest</a> describes the how the application installs and what files to install on the client. Once again, let&#8217;s have a look at the contents:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;asmv1:assembly xsi:schemaLocation=&quot;urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd&quot; manifestVersion=&quot;1.0&quot; xmlns:asmv3=&quot;urn:schemas-microsoft-com:asm.v3&quot; xmlns:dsig=&quot;http://www.w3.org/2000/09/xmldsig#&quot; xmlns=&quot;urn:schemas-microsoft-com:asm.v2&quot; xmlns:asmv1=&quot;urn:schemas-microsoft-com:asm.v1&quot; xmlns:asmv2=&quot;urn:schemas-microsoft-com:asm.v2&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:co.v1=&quot;urn:schemas-microsoft-com:clickonce.v1&quot;&gt;
  &lt;asmv1:assemblyIdentity name=&quot;App.exe&quot; version=&quot;1.0.903.18476&quot; publicKeyToken=&quot;0000000000000000&quot; language=&quot;neutral&quot; processorArchitecture=&quot;msil&quot; type=&quot;win32&quot; /&gt;
  &lt;application /&gt;
  &lt;entryPoint&gt;
    &lt;assemblyIdentity name=&quot;App&quot; version=&quot;1.0.903.18476&quot; language=&quot;neutral&quot; processorArchitecture=&quot;msil&quot; /&gt;
    &lt;commandLine file=&quot;App.exe&quot; parameters=&quot;&quot; /&gt;
  &lt;/entryPoint&gt;
  &lt;trustInfo&gt;
    &lt;security&gt;
      &lt;applicationRequestMinimum&gt;
        &lt;PermissionSet Unrestricted=&quot;true&quot; ID=&quot;Custom&quot; SameSite=&quot;site&quot; /&gt;
        &lt;defaultAssemblyRequest permissionSetReference=&quot;Custom&quot; /&gt;
      &lt;/applicationRequestMinimum&gt;
      &lt;requestedPrivileges xmlns=&quot;urn:schemas-microsoft-com:asm.v3&quot;&gt;
        &lt;requestedExecutionLevel level=&quot;asInvoker&quot; uiAccess=&quot;false&quot; /&gt;
      &lt;/requestedPrivileges&gt;
    &lt;/security&gt;
  &lt;/trustInfo&gt;
  &lt;dependency&gt;
    &lt;dependentOS&gt;
      &lt;osVersionInfo&gt;
        &lt;os majorVersion=&quot;5&quot; minorVersion=&quot;1&quot; buildNumber=&quot;0&quot; servicePackMajor=&quot;0&quot; /&gt;
      &lt;/osVersionInfo&gt;
    &lt;/dependentOS&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly dependencyType=&quot;preRequisite&quot; allowDelayedBinding=&quot;true&quot;&gt;
      &lt;assemblyIdentity name=&quot;Microsoft.Windows.CommonLanguageRuntime&quot; version=&quot;2.0.50727.0&quot; /&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly dependencyType=&quot;install&quot; allowDelayedBinding=&quot;true&quot; codebase=&quot;DevExpress.Data.v9.1.dll&quot; size=&quot;855552&quot;&gt;
      &lt;assemblyIdentity name=&quot;App&quot; version=&quot;9.1.5.0&quot; publicKeyToken=&quot;B88D1754D700E49A&quot; language=&quot;neutral&quot; processorArchitecture=&quot;msil&quot; /&gt;
      &lt;hash&gt;
        &lt;dsig:Transforms&gt;
          &lt;dsig:Transform Algorithm=&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot; /&gt;
        &lt;/dsig:Transforms&gt;
        &lt;dsig:DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot; /&gt;
        &lt;dsig:DigestValue&gt;CXehkPHON56TeTj7ZWsy++QsymE=
      &lt;/hash&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  &lt;file name=&quot;GlobalConfiguration.xml&quot; size=&quot;21074&quot;&gt;
    &lt;hash&gt;
      &lt;dsig:Transforms&gt;
        &lt;dsig:Transform Algorithm=&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot; /&gt;
      &lt;/dsig:Transforms&gt;
      &lt;dsig:DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot; /&gt;
      &lt;dsig:DigestValue&gt;6hHtbL9F9sfgWmKLYrWRpYmILCE=
    &lt;/hash&gt;
  &lt;/file&gt;
&lt;/asmv1:assembly&gt;
</pre>
<p>The first tag of interest here is the <em>entryPoint</em> tag that identifies the application to run once the installation completes. In order to start the application clickonce will execute the command with the parameters specified in the <em>commandLine</em> tag.</p>
<p>Every application has dependencies that must either be installed with the program or should have been installed. In the first <em>dependency</em> tag we see that the minimum <a href="http://support.microsoft.com/kb/189249">operating system version</a> required is Windows XP. In the second dependency tag we see that the <em>dependencyType</em> attribute instructs clickonce to verify that the .NET Framework 2.0 is already installed on the client.</p>
<p>In the third dependency tag we see that the <em>dependencyType</em> is <em>install</em>, which instructs clickonce to install this dependency on the client. Remember that the .deploy extension will automatically be removed during the installation process.</p>
<p>The next tag is a file tag that specifies a non-assembly file that is copied into the application installation directory. <em>Note:</em> by default when clickonce encounters a xml file it assumes it as a configuration file and will copy it to a data directory; along the application directory; instead of the application directory. You can find the data directory location by querying the <em>System.Deployment.ApplicationApplicationDeployment.DataDirectory</em> property<em>.<br />
</em></p>
<p>In the <a href="http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-part3/">next installment</a> of this series we will show a build file example and generate a deployment manifest with the <a href="http://msdn.microsoft.com/en-us/library/acz3y3te%28VS.80%29.aspx">Mage</a> tool.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=278&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2010/03/20/automating-a-clickonce-deployment-%e2%80%93-part2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>
	</item>
		<item>
		<title>Executing a task remotely with MsBuild</title>
		<link>http://thirdshelf.com/2009/10/19/executing-a-task-remotely-with-msbuild/</link>
		<comments>http://thirdshelf.com/2009/10/19/executing-a-task-remotely-with-msbuild/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 16:47:36 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[team foundation server]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=282</guid>
		<description><![CDATA[Recently, we were in need of executing a command on a remote server as part of our automated build process. For this we decided to make use of Windows Management Instrumentation (WMI). Before jumping to the code, copying and pasting it, there are always some security issues that need to be addressed. For this task [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=282&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, we were in need of executing a command on a remote server as part of our automated build process. For this we decided to make use of <a href="http://en.wikipedia.org/wiki/Windows_Management_Instrumentation">Windows Management Instrumentation</a> (WMI). Before jumping to the code, copying and pasting it, there are always some security issues that need to be addressed. For this task there are also some service configurations that are required on the remote machine.</p>
<p><strong>Note: </strong>All of the following settings are configured on the remote machine on which the command will be run remotely.</p>
<p><strong>Security</strong></p>
<p><em>Follow the steps below to set the WMI permissions for the build service account:</em></p>
<ol>
<li>Click on <strong>Start</strong> &gt; <strong>Control Panel</strong> &gt; <strong>Administrative Tools</strong> &gt; <strong>Computer Management</strong>.</li>
<li>Expand <strong>Service and Applications</strong>.</li>
<li>Right-click on <strong>WMI Control</strong> and click on <strong>Properties</strong>.</li>
<li>On the property dialog select the <strong>Security</strong> tab.</li>
<li>Expand <strong>Root</strong> &gt; <strong>CIMV2</strong>.</li>
<li>Click on the <strong>Security</strong> button.</li>
<li>Click on <strong>Add</strong> and add &lt;TFSSERVICE&gt; account.</li>
<li>In the list of permissions, allow the following permissions:
<ul>
<li>Execute methods</li>
</ul>
<ul>
<li>Remote enable</li>
</ul>
</li>
<li>Click on <strong>OK</strong>.</li>
</ol>
<p><em>Follow the step below to set the Local Security Policy for the build service account:</em></p>
<ol>
<li>Click on <strong>Start</strong> &gt; <strong>Control Panel</strong> &gt; <strong>Administrative Tools</strong> &gt; <strong>Local Security Policy</strong>.</li>
<li>Expand <strong>Local Policies</strong> &gt; <strong>User Rights Assignment</strong>.</li>
<li>Find and double-click on <strong>Log on as a service</strong>.</li>
<li>Click on <strong>Add User or Group</strong> and add &lt;TFSSERVICE&gt; account.</li>
<li>Click on <strong>OK</strong>.</li>
<li>Find and double-click <strong>Log on as a batch job</strong>.</li>
<li>Click on <strong>Add User or Group</strong> and add &lt;TFSSERVICE&gt; account.</li>
<li>Click on <strong>OK</strong> and close the <strong>Local Security Policy</strong> window.</li>
</ol>
<p><strong>Services</strong></p>
<p><em>Follow the steps below set the dependent services to automatically start:</em></p>
<ol>
<li>Click on <strong>Start </strong>&gt; <strong>Control Panel</strong> &gt; <strong>Administrative Tools</strong>.</li>
<li>Double click on <strong>Services</strong>.</li>
<li>Ensure that the following services are <strong>Started</strong>, and are set to start <strong>Automatic</strong>.
<ul>
<li>COM+ Event System</li>
<li>Remote Access Auto Connection Manager</li>
<li>Remote Access Connection Manager</li>
<li>Remote Procedure Call (RPC)</li>
<li>Remote Procedure Call (RPC) Locator</li>
<li>Remote Registry</li>
<li>Server</li>
<li>Windows Management Instrumentation</li>
<li>Windows Management Instrumentation Driver Extensions</li>
<li>WMI Performance Adapter</li>
<li>Workstation</li>
</ul>
</li>
<li>Close the services dialog.</li>
</ol>
<p>Here is the code for the build task that will execute a command on a remote machine:</p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
/// Executes a command line on a remote machine.
/// &lt;/summary&gt;
public class RemoteExec : Task
{
 /// &lt;summary&gt;
 /// Initialises a new instance of the &lt;see cref=&quot;RemoteExec&quot;/&gt; class.
 /// &lt;/summary&gt;
 public RemoteExec()
 {
   RemoteMachine = Environment.MachineName;
 }

 /// &lt;summary&gt;
 /// Gets or sets the name of the machine on which to execute the command.
 /// &lt;/summary&gt;
 public string RemoteMachine
 {
   get;
   set;
 }

 /// &lt;summary&gt;
 /// Gets or sets the command to execute on the remote machine.
 /// &lt;/summary&gt;
 [Required]
 public string Command
 {
   get;
   set;
 }

 /// &lt;summary&gt;
 /// Executes the task on the remote machine.
 /// &lt;/summary&gt;
 /// &lt;returns&gt;true if the task succeeded, otherwise, false&lt;/returns&gt;
 public override bool Execute()
 {
   if (string.IsNullOrEmpty(Command))
   {
     Log.LogError(&quot;Command property was not set.&quot;);
     throw new ArgumentNullException(&quot;Command&quot;);
   }

   var connOptions = new ConnectionOptions();
   connOptions.Impersonation = ImpersonationLevel.Impersonate;
   connOptions.EnablePrivileges = true;

   var managementScope = new ManagementScope(
     string.Format(@&quot;\\{0}\ROOT\CIMV2&quot;, RemoteMachine), connOptions);
   managementScope.Connect();

   Log.LogMessage(string.Format(CultureInfo.CurrentCulture, &quot;Connected to {0}: {1}&quot;,
   RemoteMachine, managementScope.IsConnected));

   if (!managementScope.IsConnected)
   return false;

   var objectGetOptions = new ObjectGetOptions();
   var managementPath = new ManagementPath(&quot;Win32_Process&quot;);
   var processClass = new ManagementClass(managementScope, managementPath, objectGetOptions);

   var processParameters = processClass.GetMethodParameters(&quot;Create&quot;);

   processParameters[&quot;CommandLine&quot;] = Command;
   try
   {
     var outParams = processClass.InvokeMethod(&quot;Create&quot;, processParameters, null);
     var processID = Convert.ToUInt32(outParams[&quot;processId&quot;]);

     Log.LogMessage(string.Format(CultureInfo.CurrentCulture,
       &quot;Creation of the process {0} returned: {1}&quot;, processID, outParams[&quot;returnValue&quot;]));

     var stopQuery = new WqlEventQuery(string.Format(CultureInfo.CurrentCulture,
       &quot;select * from Win32_ProcessStopTrace where ProcessID={0}&quot;, processID));

     var processStopEvent = new ManagementEventWatcher(managementScope, stopQuery);
     processStopEvent.Options.Timeout = new TimeSpan(0, 1, 0);

     Log.LogMessage(&quot;Waiting for process to complete...&quot;);
     processStopEvent.WaitForNextEvent();
     processStopEvent.Stop();

     Log.LogMessage(&quot;Completed.&quot;);
   }
   catch (Exception ex)
   {
     Log.LogError(ex.Message);
   }

   return true;
   }
}
</pre>
<p>The task can then be used as follows:</p>
<pre class="brush: xml;">
&lt;UsingTask TaskName=&quot;RemoteExec&quot; AssemblyFile=&quot;BuildTasks.dll&quot;/&gt;
&lt;RemoteExec RemoteMachine=&quot;$(Server)&quot; Command=&quot;application.exe&quot; /&gt;
</pre>
<p>There we have it, executing a command remotely from MsBuild!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=282&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2009/10/19/executing-a-task-remotely-with-msbuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating JunctionPoints with MsBuild</title>
		<link>http://thirdshelf.com/2009/10/10/creating-junctionpoints-with-msbuild/</link>
		<comments>http://thirdshelf.com/2009/10/10/creating-junctionpoints-with-msbuild/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 14:32:37 +0000</pubDate>
		<dc:creator>Sydney du Plooy</dc:creator>
				<category><![CDATA[team foundation server]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://thirdshelf.com/?p=260</guid>
		<description><![CDATA[With our build process we decided on a deployment folder structure that required us to create NTFS Junction Points. Junction Points are links to other folders, also known as soft links. Below is an example of how these links appear in Windows 7. It also shows our deployment folders for various build types: All the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=260&subd=thirdshelf&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>With our build process we decided on a deployment folder structure that required us to create <a href="http://en.wikipedia.org/wiki/NTFS_junction_point">NTFS Junction Points</a>. Junction Points are links to other folders, also known as soft links. Below is an example of how these links appear in Windows 7. It also shows our deployment folders for various build types:</p>
<p style="text-align:left;"><img class="size-full wp-image-262  aligncenter" title="JunctionPointFolderStructure" src="http://thirdshelf.files.wordpress.com/2009/09/junctionpointfolderstructure.png?w=416&#038;h=90" alt="JunctionPointFolderStructure" width="416" height="90" />All the folders with shortcut arrows are junction points or links to folders in the <em>Published</em> folder. For each build, the binaries are copied to a build numbered folder in the <em>Published</em> folder. Only when a build is successful; meaning that all code compiled and unit tests passed; do we update the junction point to the relevant build numbered folder in <em>Published</em>.</p>
<p>By using the code written by Jeff Brown in this <a href="http://www.codeproject.com/KB/files/JunctionPointsNet.aspx">article</a>, I was able to create a custom build task that enabled us to the create and delete junction points with relative ease. Here is a <a href="http://www.mediafire.com/?sharekey=8d2e5bea19404d71d9d5c56d04dfa8b0e04e75f6e8ebb871">link</a> to the source code for an MsBuild task that will enable you to manage junction points with MsBuild.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thirdshelf.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thirdshelf.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thirdshelf.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thirdshelf.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thirdshelf.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thirdshelf.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thirdshelf.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thirdshelf.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thirdshelf.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thirdshelf.wordpress.com/260/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thirdshelf.com&blog=3179385&post=260&subd=thirdshelf&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://thirdshelf.com/2009/10/10/creating-junctionpoints-with-msbuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sydney</media:title>
		</media:content>

		<media:content url="http://thirdshelf.files.wordpress.com/2009/09/junctionpointfolderstructure.png" medium="image">
			<media:title type="html">JunctionPointFolderStructure</media:title>
		</media:content>
	</item>
	</channel>
</rss>