<?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>IProgrammable &#187; Continuous Integration</title>
	<atom:link href="http://www.iprogrammable.com/category/continuous-integration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iprogrammable.com</link>
	<description>Kawalerowicz Consulting News</description>
	<lastBuildDate>Wed, 15 Feb 2012 13:21:34 +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>More on &#8220;Continuous Integration in .NET&#8221;</title>
		<link>http://www.iprogrammable.com/2011/11/11/more-on-continuous-integration-in-net/</link>
		<comments>http://www.iprogrammable.com/2011/11/11/more-on-continuous-integration-in-net/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 14:46:40 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[DotNet]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2011/11/11/more-on-continuous-integration-in-net/</guid>
		<description><![CDATA[I’ve recently got the sales report from Manning about my book “Continuous Integration in .NET”. I’m very happy to report it sells quite well! And speaking about the book. My friend Mateusz Łoskot send me an excerpt from the ACCU discussion board discussing my book. Here it is: &#62; Interesting you mention the Manning books [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve recently got the sales report from Manning about my book “Continuous Integration in .NET”. I’m very happy to report it sells quite well!</p>
<p>And speaking about the book. My friend <a href="http://mateusz.loskot.net/" target="_blank">Mateusz Łoskot</a> send me an excerpt from the <a href="http://accu.org/" target="_blank">ACCU</a> discussion board discussing my book. Here it is:</p>
<p><em>&gt; Interesting you mention the Manning books on Dependency Injection and Continuous Integration&#8230; is there really a whole books-worth of stuff in each of those topics??</em></p>
<p><em>If you are in the .NET world then then &#8216;Continuous Integration in     <br />.NET&#8217; is really worth the time invested. It covers most of commonly      <br />used tools (CC.NET, MSBuild &amp; Team System, TeamCity). Goes over      <br />integration of unit testing, code metrics, analyse tools, source      <br />control and these like (if I recall correctly there is a section on      <br />building installation package and getting you DB related changes under      <br />CI as well).</em></p>
<p><em>However, it lack some obscure topics (e.g. I would really like to     <br />facilitate Hudson, Maven and Sonar, but I don&#8217;t even recall a word on      <br />these also NAnt isn&#8217;t presented too well).</em></p>
<p><em>Even thought, if you are just starting with CI I would give it a go.</em></p>
<p><em>You could skip it if you already have some CI in house and just need     <br />to improve / extend what it offers. It&#8217;s alway nice to have a look      <br />around, but I find hands-on experience much more important in this      <br />area.</em></p>
<p><a href="http://www.manning.com/affiliate/idevaffiliate.php?id=1106_211" target="_blank">So be my guest!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2011/11/11/more-on-continuous-integration-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 Professional and Hudson / Jenkins CI and FxCop</title>
		<link>http://www.iprogrammable.com/2011/06/15/visual-studio-2010-professional-and-hudson-jenkins-ci-and-fxcop/</link>
		<comments>http://www.iprogrammable.com/2011/06/15/visual-studio-2010-professional-and-hudson-jenkins-ci-and-fxcop/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 09:03:35 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[DotNet]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2011/06/15/visual-studio-2010-professional-and-hudson-jenkins-ci-and-fxcop/</guid>
		<description><![CDATA[&#160; Visual Studio 2010 Premium and Ultimate do have the code analysis feature build in. What this feature does is static code analysis of your source code (or IL to be specific). Unfortunately the Professional edition lacks the build in integration (no Analysis tab in the project properties). Here is a way to easily integrate [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Visual Studio 2010 Premium and Ultimate do have the code analysis feature build in. What this feature does is static code analysis of your source code (or IL to be specific). Unfortunately the Professional edition lacks the build in integration (no Analysis tab in the project properties). Here is a way to easily integrate Visual Studio 2010 Professional with FxCop. FxCop is a standalone Code Analysis version that comes together with “Microsoft Windows SDK for Windows 7 and .NET Framework 4 Version 7.1”. Actually if you download and install the SDK you will get the FxCop installer in %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop. You will have to install it from there (yeah installer in a installer <img src='http://www.iprogrammable.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Here is how to built it into Visual Studio 2010 and into continuous integration process. First of all, I like to have all the assets in my repository. So I went and copied all the FxCop files into the tools/FxCop directory into the repository. I didn’t wanted to use the FxCop project files (they add unnecessary friction with editing the file – sometimes on runtime). I decided to go the command line way all the way. The easiest solution is to define all the rules you want to obey in the ruleset file. Ruleset file is a XML file that looks like this:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;?</span><span style="color: #800000">xml</span> <span style="color: #ff0000">version</span><span style="color: #0000ff">=&quot;1.0&quot;</span> <span style="color: #ff0000">encoding</span><span style="color: #0000ff">=&quot;utf-8&quot;</span>?<span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">RuleSet</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Codefusion Rules&quot;</span> <span style="color: #ff0000">Description</span><span style="color: #0000ff">=&quot;This is the Codefusion rule set.&quot;</span> <span style="color: #ff0000">ToolsVersion</span><span style="color: #0000ff">=&quot;10.0&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">Localization</span> <span style="color: #ff0000">ResourceAssembly</span><span style="color: #0000ff">=&quot;Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll&quot;</span> <span style="color: #ff0000">ResourceBaseName</span><span style="color: #0000ff">=&quot;Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Name</span> <span style="color: #ff0000">Resource</span><span style="color: #0000ff">=&quot;ExtendedDesignGuidelineRules_Name&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Description</span> <span style="color: #ff0000">Resource</span><span style="color: #0000ff">=&quot;ExtendedDesignGuidelineRules_Description&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Localization</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">IncludeAll</span> <span style="color: #ff0000">Action</span><span style="color: #0000ff">=&quot;Error&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">Rules</span> <span style="color: #ff0000">AnalyzerId</span><span style="color: #0000ff">=&quot;Microsoft.Analyzers.ManagedCodeAnalysis&quot;</span> <span style="color: #ff0000">RuleNamespace</span><span style="color: #0000ff">=&quot;Microsoft.Rules.Managed&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Rule</span> <span style="color: #ff0000">Id</span><span style="color: #0000ff">=&quot;CA1000&quot;</span> <span style="color: #ff0000">Action</span><span style="color: #0000ff">=&quot;Warining&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Rules</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">RuleSet</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>The example above states that all the rules (IncludeAll) are threated as errors with one exception being a Warning (&lt;Rule Id=…). You can define the rules as you wish. Fortunately Visual Studio 2010 Professional has the build in editor for the ruleset files. Using this editor you can easily choose the rules to obey (or not).</p>
<p><a href="http://www.iprogrammable.com/files/2011/06/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.iprogrammable.com/files/2011/06/image_thumb.png" width="400" height="164" /></a></p>
<p>When you are done with the ruleset place it somewhere in your repository and define post build event like this one:</p>
<p><a href="http://www.iprogrammable.com/files/2011/06/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.iprogrammable.com/files/2011/06/image_thumb1.png" width="244" height="166" /></a></p>
<p>The text for the post build event is:</p>
<p><font size="2" face="Courier New">if $(ConfigurationName) == Release $(SolutionDir)Codefusion.Common\Tools\FxCop\FxCopCmd.exe /file:$(SolutionDir)S000.Basic\bin\$(ConfigurationName)\Codefusion.S000.Basic.dll /ruleset:=$(SolutionDir)Codefusion.Common\FxCopRules\CodefusionRules.ruleset /rulesetdirectory:$(SolutionDir)Codefusion.Common\Tools\FxCop\Rules /console</font></p>
<p>This way if you compile the project in Release mode you will get all the rules defined in ruleset file checked. You will see the violations in the Error List area. You can still jump to the line where violation occurs by double-clicking the line with report.</p>
<p>You can always suppress the messages for the rules you chosen to obey if in this particular case they don’t make sense. You can do it globally in the GlobalSuppressions.cs file. Like that:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(<span style="color: #006080">&quot;Microsoft.Naming&quot;</span>, <span style="color: #006080">&quot;CA1704:IdentifiersShouldBeSpelledCorrectly&quot;</span>, MessageId = <span style="color: #006080">&quot;Codefusion&quot;</span>)]</pre>
<p><!--CRLF--></div>
</div>
<p>Or directly in the code like that:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> [System.Diagnostics.CodeAnalysis.SuppressMessage(<span style="color: #006080">&quot;Microsoft.Performance&quot;</span>, <span style="color: #006080">&quot;CA1820:TestForEmptyStringsUsingStringLength&quot;</span>)]</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">string</span> MakeMD5Hash(<span style="color: #0000ff">this</span> <span style="color: #0000ff">string</span> <span style="color: #0000ff">value</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> == <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>         <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> ArgumentNullException(<span style="color: #006080">&quot;value&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> == <span style="color: #0000ff">string</span>.Empty)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> ArgumentException(Resources.BasicStrings.ErrorMsgValueCannotBeEmpty + <span style="color: #006080">&quot;.&quot;</span>, <span style="color: #006080">&quot;value&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span> ...</pre>
<p><!--CRLF--></div>
</div>
<p>To make the suppressions work (suppressions are inline or global exceptions from the ruleset) you will have to define the compiler directive like that:</p>
<p><a href="http://www.iprogrammable.com/files/2011/06/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.iprogrammable.com/files/2011/06/image_thumb2.png" width="244" height="63" /></a></p>
<p>It will define a constant in the project file:</p>
<p>&lt;DefineConstants&gt;CODE_ANALYSIS&lt;/DefineConstants&gt;</p>
<p>If you are using the continuous integration technique you can put the command similar to the one in post build event into the build project. In MSBuild it will look like this:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Target</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Analysis&quot;</span> <span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">Exec</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;$(MSBuildProjectDirectory)\Codefusion.Common\Tools\FxCop\FxCopCmd.exe /file:S000.Basic\bin\$(Configuration)\Codefusion.S000.Basic.dll /ruleset:=Codefusion.Common\FxCopRules\CodefusionRules.ruleset /rulesetdirectory:Codefusion.Common\Tools\FxCop\Rules /out:FxCopReport.xml /forceoutput&quot;</span> <span style="color: #ff0000">ContinueOnError</span><span style="color: #0000ff">=&quot;false&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Target</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>This way you will get get the XML file with the violations report that your CI server can interpret and thanks to the ContinueOnError=”false” attribute you will get the broken build if any of the violations will be found. </p>
<p>In Hudson/Jenkins you can use the Violations plug-in (you will have to install it) to show the violations in the build report. To do so you need to to configure the project like this:</p>
<p><a href="http://www.iprogrammable.com/files/2011/06/image3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.iprogrammable.com/files/2011/06/image_thumb3.png" width="244" height="107" /></a></p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2011/06/15/visual-studio-2010-professional-and-hudson-jenkins-ci-and-fxcop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration in .NET &#8211; dead tree edition</title>
		<link>http://www.iprogrammable.com/2011/03/13/continuous-integration-in-net-dead-tree-edition/</link>
		<comments>http://www.iprogrammable.com/2011/03/13/continuous-integration-in-net-dead-tree-edition/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 21:12:01 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[DotNet]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2011/03/13/continuous-integration-in-net-dead-tree-edition/</guid>
		<description><![CDATA[Finally it happened. I’ve just got my author copies of “Continuous Integration in .NET” the book I coauthored. I’m very, very happy because it was a long journey and finally it happened. My first book is out. I would like to thank all the people who helped at Manning and outside. I was considering writing [...]]]></description>
			<content:encoded><![CDATA[<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="Continuous Integration in .NET Author&#39;s Copies" border="0" alt="Continuous Integration in .NET Author&#39;s Copies" align="left" src="http://www.iprogrammable.com/files/2011/03/image.png" width="244" height="199" />Finally it happened. I’ve just got my author copies of “<a href="www.amazon.com/gp/product/1935182552/" target="_blank">Continuous Integration in .NET</a>” the book I coauthored. I’m very, very happy because it was a long journey and finally it happened. My first book is out. I would like to thank all the people who helped at Manning and outside. I was considering writing a longer post about the process, the ups and the downs, but I decided not to. I might return to that thought later. In a mean time if you are considering coauthoring a book with someone you don’t know think twice. If you are considering writing something together with Craig Berntson and want to know my honest opinion write to me. Hoppe you will consider this book interesting. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2011/03/13/continuous-integration-in-net-dead-tree-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hudson Continuous Integration LED message board monitor</title>
		<link>http://www.iprogrammable.com/2011/01/02/hudson-continuous-integration-led-message-board-monitor/</link>
		<comments>http://www.iprogrammable.com/2011/01/02/hudson-continuous-integration-led-message-board-monitor/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 20:59:35 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[DotNet]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2011/01/02/hudson-continuous-integration-led-message-board-monitor/</guid>
		<description><![CDATA[Knowing the state of the build is one of the most important aspects of Continuous Integration. Team should get the information about the problems with he build as soon as possible. If the quality of source code degrades rendering the build to fail team, should jump in and fix the problem. The most popular group [...]]]></description>
			<content:encoded><![CDATA[<p>Knowing the state of the build is one of the most important aspects of Continuous Integration. Team should get the information about the problems with he build as soon as possible. If the quality of source code degrades rendering the build to fail team, should jump in and fix the problem.</p>
<p>The most popular group of tools that make the swift reaction possible are the tray notifiers. Small programs that reside somewhere in the corner of the screen and show one of the 3 states the build server is ever in:</p>
<p>1. Building</p>
<p>2. Failed</p>
<p>3. Yet another successful build!</p>
<p>Oh, and well… not working (if the CI server is down). Some teams use emails or even SMS to inform about the broken build. Fore some it is not enough. The history of “alternative feedback mechanism” is long. It includes inventions like:</p>
<p>- <a href="http://blogs.msdn.com/b/mswanson/archive/2004/06/29/169058.aspx" target="_blank">Ambient Orb</a></p>
<p>- <a href="http://wiki.hudson-ci.org/pages/viewpage.action?pageId=20250625" target="_blank">Read Bear Alert!</a></p>
<p>- <a href="http://www.bradders.org/trafficlights/" target="_blank">Traffic Lights</a> (to tell you the truth it is my favourite!)</p>
<p>I didn’t wanted to be worse. I wanted my won gadget. My budget was limited so I’ve picked something cheap but funny. What can be cheaper than USB toy, I thought. But finding a device that can be customized/programmed was not so easy. Most of the USB toys are dummy devices that take the 5V from the USB socket to simply power something up. But after a small research I’ve stumbled upon something interesting: <a href="http://www.dreamcheeky.com/led-message-board" target="_blank">LED Message Board from Dream Cheeky</a>. I’ve asked the manufacturer about the possibility to program the device and received short but complete instruction how to use it programmatically.</p>
<p><a href="http://www.iprogrammable.com/files/2011/01/image.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="LED Message Board for Hudson CI server" border="0" alt="LED Message Board for Hudson CI server" align="left" src="http://www.iprogrammable.com/files/2011/01/image_thumb.png" width="240" height="174" /></a></p>
<p>The LED Message Board is a HID device. HID stays for Human Interface Device – a device that can interact with humans. In my case it was the device input that should interact with my developers and show them that something is wrong on the CI server. So I’ve looked for a HID library on the net and found a nice piece of work from <a href="http://labs.mikeobrien.net/Document.aspx?id=hidlibrary" target="_blank">Mike Obrien</a>. A .NET Framework library ready to use with any HID device. Neat!</p>
<p>We are using Hudson CI at CODEFUSION (my company). It has a nice XML API (next to JSON and Python API) that anyone can use of. So I had everything I needed to start coding (for fun)!</p>
<p><strong>Getting Hudson CI build state</strong></p>
<p>As I mentioned earlier Hudson CI exposes quite robust <a href="http://wiki.hudson-ci.org/display/HUDSON/Remote+access+API" target="_blank">XML API</a> that you can consume over HTTP as you like. To get the basic information about all available APIs substitute your Hudson URL with API like this:</p>
<p><a href="http://yourserver/hudson/api">http://yourserver/hudson/api</a></p>
<p>To the the the basic XML API document write api/xml:</p>
<p><a href="http://yourserver/hudson/api/xml">http://yourserver/hudson/api/xml</a></p>
<p>This document holds only the subset of information&#8217;s that Hudson CI can deliver. The fist level does not contain what I needed – the information if any of the jobs defined is in broken state. Trying another depths /api/xml?depth=1I found the last buildResult in jobs that was what I needed! You can filter the returned XML using the tree parameter like this:</p>
<p><a href="http://yourserver/hudson/api/xml?tree=jobs[name,lastBuild[result">http://yourserver/hudson/api/xml?tree=jobs[name,lastBuild[result</a>]]</p>
<p>In return I’ve got nicely formatted XML with all the data I’ve needed</p>
<p><font size="3"></font></p>
<p><font size="3"></font></p>
<pre class="csharpcode">&lt;hudson&gt;
  &lt;job&gt;
    &lt;name&gt;S000.Framework&lt;/name&gt;
    &lt;lastBuild&gt;
      &lt;result&gt;SUCCESS&lt;/result&gt;
    &lt;/lastBuild&gt;
  &lt;/job&gt;
  &lt;job&gt;
    &lt;name&gt;S001.Cfms&lt;/name&gt;
    &lt;lastBuild&gt;
      &lt;result&gt;SUCCESS&lt;/result&gt;
    &lt;/lastBuild&gt;
  &lt;/job&gt;
&lt;/hudson&gt;</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>All I needed now is to get the file and parse it. One more thing I had to do before it was possible. My Hudson CI server uses the Active Directory authentication. There is access without an AD account and a proper values in Hudson security matrix. After some investigation on the HTTP communication the browser is normally performing with the server (I used Firebug – excellent Firefox plug-in for web developers) I’ve came with following code:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">// Non blocking lock</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">if</span> (Monitor.TryEnter(_TimerLocker))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #008000">// Create web client instance</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     MyWebClient WebClient = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     <span style="color: #0000ff">try</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>         WebClient = <span style="color: #0000ff">new</span> MyWebClient();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>         <span style="color: #008000">// Log-in in if neccessary</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>         <span style="color: #0000ff">if</span> (_UserName != <span style="color: #0000ff">null</span> &amp;&amp; _Password != <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>             <span style="color: #008000">// Readc login page and dump result to dummy string</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>             <span style="color: #0000ff">string</span> Dump = (<span style="color: #0000ff">new</span> StreamReader(WebClient.OpenRead(_Uri.ToString() + <span style="color: #006080">&quot;loginEntry&quot;</span>))).ReadToEnd();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>             System.Collections.Specialized.NameValueCollection Variables = <span style="color: #0000ff">new</span> System.Collections.Specialized.NameValueCollection();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>             Variables.Add(<span style="color: #006080">&quot;j_username&quot;</span>, _UserName);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>             Variables.Add(<span style="color: #006080">&quot;j_password&quot;</span>, _Password);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>             Variables.Add(<span style="color: #006080">&quot;from&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>             Variables.Add(<span style="color: #006080">&quot;Submit&quot;</span>, <span style="color: #006080">&quot;log in&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>             WebClient.UploadValues(_Uri.ToString() + <span style="color: #006080">&quot;j_acegi_security_check&quot;</span>, <span style="color: #006080">&quot;POST&quot;</span>, Variables);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>         StreamReader RequestReader = <span style="color: #0000ff">new</span> StreamReader(WebClient.OpenRead(_Uri.ToString() + _HudsonFiler));</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>         <span style="color: #0000ff">string</span> ResponseFromServer = RequestReader.ReadToEnd();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>         XElement XElement = XElement.Parse(ResponseFromServer);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>         <span style="color: #0000ff">foreach</span> (XElement Element <span style="color: #0000ff">in</span> XElement.Elements())</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>             <span style="color: #008000">// TODO mk from mk; meybe add project filtering</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span>             <span style="color: #008000">//Element.Element(&quot;name&quot;);</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span>             XElement LastBuildElement = Element.Element(<span style="color: #006080">&quot;lastBuild&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span>             <span style="color: #0000ff">if</span> (LastBuildElement != <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>             {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span>                 XElement IsSuccessResult = LastBuildElement.Element(<span style="color: #006080">&quot;result&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span>                 <span style="color: #0000ff">if</span> (IsSuccessResult != <span style="color: #0000ff">null</span> &amp;&amp; IsSuccessResult.Value.Equals(<span style="color: #006080">&quot;FAILURE&quot;</span>))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span>                 {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span>                     _IsOk = <span style="color: #0000ff">false</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span>                     <span style="color: #0000ff">break</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum45">  45:</span>                 }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum46">  46:</span>             }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum47">  47:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum48">  48:</span>             _IsOk = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum49">  49:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum50">  50:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum51">  51:</span>     <span style="color: #0000ff">catch</span> (Exception ex)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum52">  52:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum53">  53:</span>         _LogProvider.Error(ex);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum54">  54:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum55">  55:</span>     <span style="color: #0000ff">finally</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum56">  56:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum57">  57:</span>         WebClient.Dispose();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum58">  58:</span>         </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum59">  59:</span>         <span style="color: #008000">// Exit from critical section</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum60">  60:</span>         Monitor.Exit(_TimerLocker);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum61">  61:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum62">  62:</span> }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum63">  63:</span> <span style="color: #0000ff">return</span> _IsOk;</pre>
<p><!--CRLF--></div>
</div>
<p>First, since I’m going to write a Windows Serve that periodically check Hudson CI I’m making a non blocking lock on the code I will run in a loop. If something hangs inside (like the HTTP request) the application will not run in a deadly loop that can eventually eat up all the resources. I’m using a overloaded WebClient class to perform all the operations. The overload was necessary because I have a secured Hudson CI server and the login is a little tricky in such case. Here is the code for the overloaded WebClient with cookie and changed timeout.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">namespace</span> HudsonLedSygnalizer</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #cc6633">#region</span> Using</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">using</span> System;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">using</span> System.Net;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     <span style="color: #0000ff">internal</span> <span style="color: #0000ff">class</span> MyWebClient : WebClient</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>         <span style="color: #cc6633">#region</span> Private variables</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         <span style="color: #0000ff">private</span> CookieContainer m_container = <span style="color: #0000ff">new</span> CookieContainer();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>         <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>         <span style="color: #cc6633">#region</span> Overrides</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>         <span style="color: #0000ff">protected</span> <span style="color: #0000ff">override</span> WebRequest GetWebRequest(Uri address)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>             WebRequest request = <span style="color: #0000ff">base</span>.GetWebRequest(address);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>             <span style="color: #0000ff">if</span> (request <span style="color: #0000ff">is</span> HttpWebRequest)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>             {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>                 (request <span style="color: #0000ff">as</span> HttpWebRequest).CookieContainer = m_container;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>                 (request <span style="color: #0000ff">as</span> HttpWebRequest).Timeout = 6000;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>             }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>             <span style="color: #0000ff">return</span> request;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>         <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>What we are about to do with it is essentially log-in like we were to log-on to the site over normal web browser. Maintaining the session by providing session cookie to the server.</p>
<p>The login URL is:</p>
<p><a href="http://yourserver/hudson/loginEntry">http://yourserver/hudson/loginEntry</a></p>
<p>You will have to read this URL to get the response cookie that needs to be maintained. The actual return is of no use to use. We are interested only in cookies. Having the cookie we can log-in. To do so you will have to send POST request to the server containing:</p>
<ol>
<li>j_username – set to the Hudson account name</li>
<li>j_password – set to the password for the Hudson account name</li>
<li>from – set to “\”</li>
<li>Submit set to “log in”</li>
</ol>
<p>If you are using AD authentication the request needs to go to:</p>
<p><a href="http://yourserver/hudson/j_acegi_security_check">http://yourserver/hudson/j_acegi_security_check</a></p>
<p></p>
<p>I was using WebClient.UploadValues to get the POST request rolling.</p>
<p>From now on you should be authenticated and ready to get the information about last builds from Hudson CI. To do it you will have to use the API provided by the CI server that I described earlier in this post. I was only interested if any of the build is broken. So I searched in a job for a result that contained FAILURE text. If found I knew that the CI server as a whole is in broken state and consequently it was the time to lighten up the alarm signal on the LED Message Board.</p>
<p><strong>Programming LED Message Board</strong></p>
<p>Every HID device has a vendor and product ID. The two numbers are unique and you need them to contact the device. The ones for LED Message Board are</p>
<pre class="code"><span style="color: blue">private int </span>_VentodId = 0x1d34;
<span style="color: blue">private int </span>_ProductId = 0x0013;</pre>
<p>Getting the device is easy with the Mike Obrien HID library I mentioned earlier:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> MyDetectMessageBoard()</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     HidDevice[] HidDeviceList;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">try</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         HidDeviceList = HidDevices.Enumerate(_VentodId, _ProductId);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         <span style="color: #0000ff">if</span> (HidDeviceList.Length &gt; 0)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>             _MessageBoard = HidDeviceList[0];</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>             _MessageBoard.Open();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     <span style="color: #0000ff">catch</span> (Exception ex)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>         _LogProvider.Error(ex);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>What I wanted to do is to simply display a “big red blinking eye” that watches my team if something is not working well on the CI server. To display the “big red eye” you will have to send following data to the device:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">byte</span>[] Packet0 = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[] { 0x00, 0x00, 0x00, 0xFF, 0xFC, 0x7F, 0xFF, 0xF8, 0x3F };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">byte</span>[] Packet1 = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[] { 0x00, 0x00, 0x02, 0xFF, 0xF0, 0x1F, 0xFF, 0xE0, 0x0F };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #0000ff">byte</span>[] Packet2 = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[] { 0x00, 0x00, 0x04, 0xFF, 0xF0, 0x1F, 0xFF, 0xF8, 0x3F };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #0000ff">byte</span>[] Packet3 = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[] { 0x00, 0x00, 0x06, 0xFF, 0xFC, 0x7F, 0xFF, 0xFF, 0xFF };</pre>
<p><!--CRLF--></div>
</div>
<p>I wrote a quick Excel sheet to calculate the hex values needed for a given display pattern.</p>
<p>To display the signal you have to do the following:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> Timer_Elapsed(<span style="color: #0000ff">object</span> sender, ElapsedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #008000">// Try to detect message board</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">if</span> (_MessageBoard == <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>         MyDetectMessageBoard();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #008000">// Try to send the signal</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>     <span style="color: #0000ff">if</span> (_MessageBoard != <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>         _MessageBoard.Write(Packet0);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>         _MessageBoard.Write(Packet1);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>         _MessageBoard.Write(Packet2);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>         _MessageBoard.Write(Packet3);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>As you can see the I’m using the Timer to display the “big red eye”. It is because the diodes are fleshing for a fraction of a second and you have to keep up refreshing them to get continuous display. I used System.Timers.Timer class to do the work. I set the interval so that the LED will flash – for a better effect.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">internal</span> LedNotifier()</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #008000">// Init timer</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     _Timer = <span style="color: #0000ff">new</span> Timer();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     _Timer.Enabled = <span style="color: #0000ff">false</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     _Timer.Interval = 1000;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     _Timer.Elapsed += <span style="color: #0000ff">new</span> ElapsedEventHandler(Timer_Elapsed);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #008000">// Init message board</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>     MyDetectMessageBoard();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>We almost have all the ingredients. The last thing is a windows service. It will be very simple service that incorporates a new timer to perform periodical checks on the Hudson CI server and if necessary turning on the LEDs. I’m not providing the source code here but you can download it here:</p>
<p><strong><strike>DOWNLOAD Hudson CI LED Notifier</strike></strong> <a href="mailto:marcin@kawalerowicz.net" target="_blank">Please write me an email to get the source code.</a></p>
<p>That&#8217;s it hope you can find any use for the information provided in that post. Here last but not least the device in motion!</p>
<p>&#160;</p>
<p><div style="padding-bottom: 0px; padding-left: 0px; width: 448px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:0e5ccdea-235f-4b90-a978-fc513f345fea" class="wlWriterEditableSmartContent">
<div><object width="448" height="277"><param name="movie" value="http://www.youtube.com/v/CgqQOZnus3w?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/CgqQOZnus3w?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="277"></embed></object></div>
<div style="width:448px;clear:both;font-size:.8em">Hudson CI LED Message Board Notifier</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2011/01/02/hudson-continuous-integration-led-message-board-monitor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speaking about continuous integration</title>
		<link>http://www.iprogrammable.com/2010/01/16/speaking-about-continuous-integration/</link>
		<comments>http://www.iprogrammable.com/2010/01/16/speaking-about-continuous-integration/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 17:09:55 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2010_01_16/speaking-about-continuous-integration/</guid>
		<description><![CDATA[I will be speaking on Wednesday (20.01.2010) in Krakow, Poland at the Karkow .NET Developers Group meeting. The session is about Continuous Integration in .NET. So if you like hear what I have to say about CI meet me at ABB ISDC, Pałac Pugetow, ul. Starowislna 13, Krakow at 18:30. I believe the attendance is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iprogrammable.com/files/2010/01/image.png"><img src="http://www.iprogrammable.com/files/2010/01/image-thumb.png" style="border: 0px none;margin: 0px 10px 0px 0px" alt="image" align="left" border="0" height="164" width="164" /></a> I will be speaking on Wednesday (20.01.2010) in Krakow, Poland at the <a href="http://ms-groups.pl/kgd.net/">Karkow .NET Developers Group</a> meeting. The session is about Continuous Integration in .NET. So if you like hear what I have to say about CI meet me at ABB ISDC, Pałac Pugetow, ul. Starowislna 13, Krakow at 18:30. I believe the attendance is free but registration is required. See you in Krakow!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2010/01/16/speaking-about-continuous-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selenium RC and FitNesse as a service on Windows Server 2008</title>
		<link>http://www.iprogrammable.com/2009/11/07/selenium-rc-and-fitnesse-as-a-service-on-windows-server-2008/</link>
		<comments>http://www.iprogrammable.com/2009/11/07/selenium-rc-and-fitnesse-as-a-service-on-windows-server-2008/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 20:19:16 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2009_11_07/selenium-rc-and-fitnesse-as-a-service-on-windows-server-2008/</guid>
		<description><![CDATA[If you are working in a team or running a continuous integration process the most comfortable way to run tools like Selenum RC Server or FitNesse is to install them as a windows service. I was doing this earlier on my old Windows Server 2003 by issuing the  instsrv.exe (to install a service) on srvany.exe [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working in a team or running a continuous integration process the most comfortable way to run tools like Selenum RC Server or FitNesse is to install them as a windows service. I was doing this earlier on my old Windows Server 2003 by issuing the  instsrv.exe (to install a service) on srvany.exe (to run anything) &#8211; both from Windows Resource Kit. I had to edit the registry to provide what exactly do I wanted to run (java –jar selenium-server.jar or java –jar fitnesse.jar).</p>
<p>But there is no Windows Resource Kit for 2008. You might use the sc.exe and get the old srvany.exe (with compatibility issues according to Microsoft itself). It would work but why bother when there is a <a href="http://iain.cx/src/nssm/">Non-Sucking Service Manager</a>! All you have to do to install a service with this tool is to download it, issue a</p>
<p>nssm.exe install SeleniumRC</p>
<p>and edit this dialog box:</p>
<p><a href="http://www.iprogrammable.com/files/2009/11/image.png"><img src="http://www.iprogrammable.com/files/2009/11/image-thumb.png" style="border: 0px none" alt="image" border="0" height="175" width="340" /></a></p>
<p>Click Install service and you are done. Selenium RC Server is installed. All you have to do is to start it. Voila!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2009/11/07/selenium-rc-and-fitnesse-as-a-service-on-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to make CruiseControl.NET accept SSL certificate under Windows Server 2008?</title>
		<link>http://www.iprogrammable.com/2009/10/24/how-to-make-cruisecontrolnet-accept-ssl-certificate-under-windows-server-2008/</link>
		<comments>http://www.iprogrammable.com/2009/10/24/how-to-make-cruisecontrolnet-accept-ssl-certificate-under-windows-server-2008/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 21:44:42 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2009_10_24/how-to-make-cruisecontrolnet-accept-ssl-certificate-under-windows-server-2008/</guid>
		<description><![CDATA[If you are running CruiseControl.NET under the Local System account and your SVN server certificate was issued by yourself (or by VisualSVN Server) you will quickly run into trouble. Normally if you run any command on your repository you will get this information: C:\Program Files\svn\bin&#62;svn log https://your_server/svn/your_repository/trunk &#8211;username username &#8211;password password Error validating server certificate [...]]]></description>
			<content:encoded><![CDATA[<p>If you are running CruiseControl.NET under the Local System account and your SVN server certificate was issued by yourself (or by VisualSVN Server) you will quickly run into trouble. Normally if you run any command on your repository you will get this information:</p>
<p>C:\Program Files\svn\bin&gt;svn log <a href="https://your_server/svn/your_repository/trunk">https://your_server/svn/your_repository/trunk</a> &#8211;username username &#8211;password password<br />
Error validating server certificate for &#8216;<a href="https://your_server:443':">https://your_server:443&#8242;:</a><br />
- The certificate is not issued by a trusted authority. Use the<br />
fingerprint to validate the certificate manually!<br />
- The certificate hostname does not match.<br />
Certificate information:<br />
- Hostname: your_server<br />
- Valid: from Sat, 26 Sep 2009 17:24:27 GMT until Tue, 24 Sep 2019 17:24:27 GMT</p>
<p>- Issuer: your_server<br />
- Fingerprint: 24:8e:f6:ba:c7:a6:3f:69:32:c0:21:92:64:44:62:fe:2c:bb:b4:69<br />
(R)eject, accept (t)emporarily or accept (p)ermanently?</p>
<p>If you accept you will not be bothered again. But CCNet works as a Windows Service. There is no one to make the decision. How to deal with this issue. Well earlier it was easy enough. You had to use one of the security holes and start cmd.exe in interactive mode wit at command (<a href="http://blog.threenine.co.uk/Posts/tabid/93/EntryId/4/CruiseControl-Accept-SSL-Certificate-Local-System-Account.aspx">look here for more details</a>). But with Windows Server 2008 it is not possible you will simply get this:</p>
<p>C:\Users\Administrator&gt;time<br />
The current time is: 23:31:11.59<br />
Enter the new time:</p>
<p>C:\Users\Administrator&gt;at 22:32 /interactive cmd.exe<br />
Warning: Due to security enhancements, this task will run at the time<br />
expected but not interactively.<br />
Use schtasks.exe utility if interactive task is required (&#8216;schtasks /?&#8217;<br />
for details).<br />
Added a new job with job ID = 1</p>
<p>How to deal with this. There is very easy solution. Set the CruiseContril.NET service “Allow to interact with desktop” flag (Start –&gt; Control Panel –&gt; Administrative Tools –&gt; Services –CruiseControl.NET) like this</p>
<p><a href="http://www.iprogrammable.com/files/2009/10/image1.png"><img src="http://www.iprogrammable.com/files/2009/10/image-thumb1.png" style="border: 0px none" alt="image" border="0" width="218" height="244" /></a></p>
<p>Restart the service and wait a while for this windows to appear:</p>
<p><a href="http://www.iprogrammable.com/files/2009/10/image2.png"><img src="http://www.iprogrammable.com/files/2009/10/image-thumb2.png" style="border: 0px none" alt="image" border="0" width="244" height="123" /></a></p>
<p>Select show me the message.</p>
<p>Voila! You have command line as Local System user available. You can now issue the</p>
<p>C:\Program Files\svn\bin&gt;svn log <a href="https://your_server/svn/your_repository/trunk">https://your_server/svn/your_repository/trunk</a> &#8211;username username &#8211;password password<br />
command and accept the SSL certificate permanently.</p>
<p><img src="http://www.iprogrammable.com/files/2009/10/image3.png" style="border: 0px none" alt="Local Service User Accepting SSL SVN certificate fir CruiseControl.NET server" border="0" width="244" height="186" /></p>
<p>From this time on you CCNet server will not have any problems with accessing your secured repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2009/10/24/how-to-make-cruisecontrolnet-accept-ssl-certificate-under-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Buy Continuous Integration in .NET book</title>
		<link>http://www.iprogrammable.com/2009/10/19/buy-continuous-integration-in-net-book/</link>
		<comments>http://www.iprogrammable.com/2009/10/19/buy-continuous-integration-in-net-book/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 05:52:50 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Continuous Integration]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2009_10_19/buy-continuous-integration-in-net-book/</guid>
		<description><![CDATA[The Continuous Integration in .NET book is available as an early access edition from MEAP. For those of you that are not familiar with MEAP it stands for Manning Early Access Program and it is the place where you can download a free chapter and buy the whole book printed or as an ebook before [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iprogrammable.com/files/2009/10/image.png"><img src="http://www.iprogrammable.com/files/2009/10/image-thumb.png" style="border: 0px none;margin: 0px 5px 0px 0px" alt="Continuous Integration in .NET book cover" align="left" border="0" width="150" height="187" /></a></p>
<p>The Continuous Integration in .NET book is available as an <a href="http://www.manning.com/kawalerowicz/">early access edition from MEAP</a>. For those of you that are not familiar with MEAP it stands for Manning Early Access Program and it is the place where you can download a free chapter and buy the whole book printed or as an ebook before it gets published. You will get continuously chapter after chapter successively as they will be written.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2009/10/19/buy-continuous-integration-in-net-book/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Next big thing &#8211; continuous integration book</title>
		<link>http://www.iprogrammable.com/2009/08/14/next-big-thing-continuous-integration-book/</link>
		<comments>http://www.iprogrammable.com/2009/08/14/next-big-thing-continuous-integration-book/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 19:39:59 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Continuous Integration]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2009_08_14/next-big-thing-continuous-integration-book/</guid>
		<description><![CDATA[I’m going to write a book about Continuous Integration in .NET for the Manning Publications. I’m sure I don’t have to tell you how exited am I. I will join the noble team of Manning authors like John Skeet, Ayende Rahien or Roy Osherove. I’ll keep you posted about the progress. In the mean time [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iprogrammable.com/files/2009/08/image.png"><img src="http://www.iprogrammable.com/files/2009/08/image-thumb.png" style="border: 0px none;margin: 0px 10px 0px 0px" alt="image" align="left" border="0" height="72" width="262" /></a> I’m going to write a book about Continuous Integration in .NET for the <a href="http://www.manning.com/">Manning Publications</a>. I’m sure I don’t have to tell you how exited am I. I will join the noble team of Manning authors like <a href="http://www.amazon.com/Depth-What-you-need-master/dp/1933988363/ref=sr_1_1?ie=UTF8&amp;qid=1250278049&amp;sr=8-1">John Skeet</a>, <a href="http://www.amazon.com/Building-Domain-Specific-Languages-Boo/dp/1933988606/ref=sr_1_1?ie=UTF8&amp;qid=1250278074&amp;sr=8-1">Ayende Rahien</a> or <a href="http://www.amazon.com/Art-Unit-Testing-Examples-NET/dp/1933988274/ref=sr_1_1?ie=UTF8&amp;qid=1250278097&amp;sr=8-1">Roy Osherove</a>. I’ll keep you posted about the progress. In the mean time let me give you some history.</p>
<p>I’ve once written an article for Software Developers Journal about Continuous Integration in .NET. It was very well received. I always thought I have a lot more to say in this topic. The idea to write a book came while speaking with my good friend hsd (well I have more and more to thank you for <img src='http://www.iprogrammable.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I’ve tried to propose the book to a polish publisher <a href="http://helion.pl/">Helion</a>. Very fortunately for me they said there is not enough place on the polish marketplace to get enough sell (<a href="http://www.iprogrammable.com/2009_05_03/ksiazka-o-continuous-integration/pl/">I’ve blogged about this in polish</a>). I presume they know better. I’ve already buried the idea about the book when I saw the <a href="http://www.amazon.com/ASP-NET-MVC-Quickly-Maarten-Balliauw/dp/184719754X">ASP.NET MVC 1.0 Quickly</a> book from <a href="http://www.packtpub.com/">Packt Publication</a>. It was written by a guy from Belgium (Maarten Balliauw). I’ve read his blog and I realized has not native English speaker. “If he can, why not to try myself?” I thought and written a short proposal for Packt. They were interested! I’ve worked on the proposal with the Acquisition Editor and I’ve shortly after that I’ve got the information that the book was “committed”. I was very, very happy until something went wrong at Packt (the went scared by a download stats of one of the tools I wanted to write about). The book was “uncommitted” and we didn’t sign the agreement. I don’t throw my hands up! I thought if they are interested probably someone else will be too. I’ve send view more proposals to other publishers and the Manning appeared. In the mean time Packt turned to be after all interested in me writing the book. The Acquisition Editor at Packt Publishing was a great guy. I’m sure it would be great to write a book for them but it was to late. Manning found me a co-writer <a href="http://www.craigberntson.com/">Craig Berntson</a>. Someone that speaks English a lot better than I and has a know how in continuous integration. The way the Manning deals with his authors seems very provisional and I’ve very glad to get this opportunity.</p>
<p>So be aware. The best Continuous Integration in .NET book comes sooner than you expected!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2009/08/14/next-big-thing-continuous-integration-book/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Writing MSBuild Custom Task</title>
		<link>http://www.iprogrammable.com/2008/03/13/writing-msbuild-custom-task/</link>
		<comments>http://www.iprogrammable.com/2008/03/13/writing-msbuild-custom-task/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 18:16:49 +0000</pubDate>
		<dc:creator>marcin.kawalerowicz</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.iprogrammable.com/2008_03_13/writing-msbuild-custom-task/</guid>
		<description><![CDATA[Scenario: we have Subversion server to manage our source code and a build server (CruiseControl.NET) to manage our deployment. We have decided to automatically set the SVN revision number to our assembly version. [assembly: System.Reflection.AssemblyVersion("1.2.3.0")] [assembly: System.Reflection.AssemblyFileVersion("1.2.3.0")] So we will replace the last 0 with the current Subversion revision number. How to do this? One [...]]]></description>
			<content:encoded><![CDATA[<p>Scenario: we have Subversion server to manage our source code and a build server (CruiseControl.NET) to manage our deployment. We have decided to automatically set the SVN revision number to our assembly version.</p>
<pre><span style="background: #f8f8f8 none repeat scroll 0% 50%">[</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">assembly</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">: </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">System</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Reflection</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">AssemblyVersion</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #ffffe6 none repeat scroll 0% 50%">"1.2.3.0"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">)]
[</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">assembly</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">: </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">System</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Reflection</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">AssemblyFileVersion</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #ffffe6 none repeat scroll 0% 50%">"1.2.3.0"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">)]</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>So we will replace the last 0 with the current Subversion revision number. How to do this? One way to achieve this is to modify the AssemblyInfo.cs and read the modified number from that exists. The file modification is easy with MSBuild Community Task FileUpdate</p>
<pre><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">&lt;</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a31515">FileUpdate </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">Files</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">Cic.P001001PropertiesAssemblyInfo.cs</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">Regex</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">(d+).(d+).(d+).(d+)</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">ReplacementText</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">$1.$2.$3.$(RevisionNumber)</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">" </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">/&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>But how to read it back? Well there is no easy way. I have written a custom MSBuidl task to achieve this like this:</p>
<pre><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">&lt;</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a31515">AssemblyInfoReader </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">Path</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">PropertiesAssemblyInfo.cs</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">Property</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">AssemblyVersion</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">&gt;
    &lt;</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a31515">Output </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">TaskParameter</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">Value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">" </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: red">ItemName</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">=</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">ApplicationVersion</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">" </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">/&gt;
&lt;/</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a31515">AssemblyInfoReader</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><br />
Writing a custom MSBuild task is fairly easy. You have to Reference Microsoft.Build.Framework and Microsoft.Build.Utilities and implement Microsoft.Build.Framework.ITask. Just like this:</p>
<pre><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">namespace </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Cic</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">MsBuildTasks
</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">public class </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">AssemblyInfoReader </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">: </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">ITask
    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">#region </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">Private Varaibels

        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">private string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">path</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">private string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">property</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">private string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;

        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">#endregion

        #region </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">Fields
        [</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">Required</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">]
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">public string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Path
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">get </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{ </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">path</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">; }
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">set </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{ </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">path </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">; }
        }

        [</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">Required</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">]
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">public string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Property
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">get </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{ </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">property</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">; }
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">set </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{ </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">property </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">; }
        }

        [</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">Output</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">]
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">public string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Value
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">get </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{ </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return this</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">; }
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">set </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{ </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">this</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">value </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">; }
        }

        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">#endregion

        #region </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">ITask Members
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">private </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">IBuildEngine </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">engine</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">IBuildEngine
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">ITask</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">BuildEngine
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">get
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">engine</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
            }
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">set
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">engine </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
            }
        }

        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">bool </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">ITask</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Execute</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">()
        {
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">message</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">value </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Empty</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">try
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">value </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">MyReadAssemblyInfoProperty</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">();
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">message </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Format</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(
                    </span><span style="background: #ffffe6 none repeat scroll 0% 50%">"AssemblyInfo property {0} read. Property value {1}"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">,
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">property</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">, </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">);
            }
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">catch </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">System</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">Exception </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">e</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">)
            {
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">message </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Format</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(
                    </span><span style="background: #ffffe6 none repeat scroll 0% 50%">"Error reading AssemblyInfo property {0}. Error: {1}"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">,
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">property</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">, </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">e</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Message</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">);
            }

            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">BuildMessageEventArgs </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">args </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">=
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">new </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">BuildMessageEventArgs</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">message</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">, </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Empty</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">, </span><span style="background: #ffffe6 none repeat scroll 0% 50%">"AssemblyInfoReaderTask"</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">,
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">MessageImportance</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Normal</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">);
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">engine</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">LogMessageEvent</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">args</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">);

            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return true</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
        }

        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">private </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">ITaskHost </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">host</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">ITaskHost </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Microsoft</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Build</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Framework</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">ITask</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">HostObject
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">get
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">host</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
            }
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">set
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">host </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">value</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
            }
        }

        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">#endregion

        #region </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">Internals
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">private string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">MyReadAssemblyInfoProperty</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">()
        {
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;

            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: green">// Eraly return
            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">if </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(!</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">System</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">IO</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">File</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Exists</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">path</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">)) </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return </span><span style="background: #ffffe6 none repeat scroll 0% 50%">""</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;

            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">foreach </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">string </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">line </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">in </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">System</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">IO</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: #a65300">File</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">ReadAllLines</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">path</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">))
            {
                </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">if </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">line</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Contains</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">property</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">))
                {
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">try
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">line</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Remove</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #e6ffff none repeat scroll 0% 50%">0</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">, </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">line</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">IndexOf</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #ffffe6 none repeat scroll 0% 50%">'"'</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">) + </span><span style="background: #e6ffff none repeat scroll 0% 50%">1</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">);
                        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">= </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Remove</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(
                            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">LastIndexOf</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #ffffe6 none repeat scroll 0% 50%">'"'</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">),
                            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Length </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">- </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">LastIndexOf</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">(</span><span style="background: #ffffe6 none repeat scroll 0% 50%">'"'</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">));
                        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: green">// return matching property value
                        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">propertyValue</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
                    }
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">catch
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">{
                        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: green">// Ignore errors
                    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">}
                }
            }

            </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: navy">return string</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">.</span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: maroon">Empty</span><span style="background: #f8f8f8 none repeat scroll 0% 50%">;
        }
        </span><span style="background: #f8f8f8 none repeat scroll 0% 50%;color: blue">#endregion
    </span><span style="background: #f8f8f8 none repeat scroll 0% 50%">}
}
</span></pre>
<p><a href="http://11011.net/software/vspaste"></a><br />
<a href="http://11011.net/software/vspaste"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iprogrammable.com/2008/03/13/writing-msbuild-custom-task/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

