<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Alkampfer's Place</title>
	
	<link>http://www.codewrecks.com/blog</link>
	<description>Wrecks of code floating in the sea of Internet</description>
	<lastBuildDate>Wed, 10 Mar 2010 15:49:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AlkampferEng" /><feedburner:info uri="alkampfereng" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>43.44754459758882</geo:lat><geo:long>12.84752368927002</geo:long><image><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url></image><feedburner:emailServiceId>AlkampferEng</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Visual Studio 2010 Intellisense does not show “Parameter Info”.</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/U_e7Dza7BbE/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/03/10/visual-studio-2010-intellisense-does-not-show-parameter-info/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:49:00 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/03/10/visual-studio-2010-intellisense-does-not-show-parameter-info/</guid>
		<description><![CDATA[
			
				
			
		
I installed on metal VS2010 RC, and when I tried to write the first line of code I see that intellisense failed to show parameter info.
 
This bring me back when I was young, and we have to remember all C stdlib functions because we used vi in linux to edit source file, but in [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F03%2F10%2Fvisual-studio-2010-intellisense-does-not-show-parameter-info%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F03%2F10%2Fvisual-studio-2010-intellisense-does-not-show-parameter-info%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I installed on metal VS2010 RC, and when I tried to write the first line of code I see that intellisense failed to show parameter info.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image_thumb1.png" width="655" height="67" /></a> </p>
<p>This bring me back when I was young, and we have to remember all C stdlib functions because we used vi in linux to edit source file, but in 2010 I’m really bad without intellisense.</p>
<p>Ok, I remember very well that SqlConnection has 2 constructors, but for complex classes working without intellisense can be a pain. Since all other functions of Intellisense work as expected I go to Tools/options menu and check the “Text Editor” / “AllLanguages” setting, and I found this</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image_thumb2.png" width="495" height="219" /></a> </p>
<p>For some strange reason, in C# this option is disabled, so I simply re-enable for all languages, now everything works as expected.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image_thumb3.png" width="907" height="129" /></a> </p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Visual Studio" rel="tag">Visual Studio</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=U_e7Dza7BbE:UaL2ZqM5MBQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=U_e7Dza7BbE:UaL2ZqM5MBQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=U_e7Dza7BbE:UaL2ZqM5MBQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=U_e7Dza7BbE:UaL2ZqM5MBQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=U_e7Dza7BbE:UaL2ZqM5MBQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=U_e7Dza7BbE:UaL2ZqM5MBQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/U_e7Dza7BbE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/03/10/visual-studio-2010-intellisense-does-not-show-parameter-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/03/10/visual-studio-2010-intellisense-does-not-show-parameter-info/</feedburner:origLink></item>
		<item>
		<title>Power of HQL – Condition on a collection</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/TINjYrmFWqY/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/03/09/power-of-hql-condition-on-a-collection/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:27:34 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Nhibernate]]></category>
		<category><![CDATA[HQL]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/03/09/power-of-hql-condition-on-a-collection/</guid>
		<description><![CDATA[
			
				
			
		
I have this piece of domain model.
 
The LinkResult class has a property called Link that point to a AnalyzedLink class that in turn has a collection of AnalyzedLinkExtClass called ExtData. All the relation are unidirectional, this means that there is nothing that bring me from AnalyzedLink to a linkResult and nothing that bring me [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F03%2F09%2Fpower-of-hql-condition-on-a-collection%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F03%2F09%2Fpower-of-hql-condition-on-a-collection%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have this piece of domain model.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/03/image_thumb.png" width="683" height="180" /></a> </p>
<p>The LinkResult class has a property called Link that point to a AnalyzedLink class that in turn has a collection of AnalyzedLinkExtClass called ExtData. All the relation are unidirectional, this means that there is nothing that bring me from AnalyzedLink to a linkResult and nothing that bring me from AnalyzedLinkExtData to the AnalyzedLink. This is the typical situation where doing complex query can be tricky</p>
<p>Now I had to find all the LinkResult objects that have Status = LinkResultStatus.Ok and the associated AnalyzedLink must not contain an AnalyzedLinkExtData with the property Source equal to a certain value.</p>
<p>The query in HQL is</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: #006080">@&quot;select L </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> from LinkResult L </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> join L.Link AL </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> where L.Status = :status and </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> not exists (from AL.ExtData ED where ED.Source = :source) </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> order by L.AnalysisDate desc&quot;</span></pre>
<p><!--CRLF--></div>
</div>
<p>This is really powerful, I can simply start the query from the LinkResult object, then join to the L.Link and set a condition on L.Status property.</p>
<p>Now I add a<strong> not exists</strong> with the condition <em>(from AL.ExtData ED where ED.Source = :source)</em> as you can see I do not need to specify any join, but I can select directly from the ExtData Collection Property of the AnalyzedLink result. The SQL generated is</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">select</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>        linkresult0_.Id <span style="color: #0000ff">as</span> Id175_,</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: #0000ff">from</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>         LinkResult linkresult0_ </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: #0000ff">inner</span> <span style="color: #0000ff">join</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>         AnalyzedLink analyzedli1_ </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>     <span style="color: #0000ff">on</span> linkresult0_.link_id=analyzedli1_.link_id </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: #0000ff">where</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>         linkresult0_.status=@p0 </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: #0000ff">and</span>  <span style="color: #0000ff">not</span> (<span style="color: #0000ff">exists</span> (<span style="color: #0000ff">select</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>             extdata2_.aled_id </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: #0000ff">from</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>             AnalyzedLinksExtData extdata2_ </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">where</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>             analyzedli1_.link_id=extdata2_.aled_link_id </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">and</span> extdata2_.aled_source=@p1)) </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>     <span style="color: #0000ff">order</span> <span style="color: #0000ff">by</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>         linkresult0_.analysisDate <span style="color: #0000ff">desc</span>;</pre>
<p><!--CRLF--></div>
</div>
<p>The real magic is done in the subquery, because you can verify that the condition on subquery contains two condition, the first is the link with the outer query, and the second one is the one we put on HQL. But you can surely appreciate the fact that in HQL the query is really clearer and shorter <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/NHibernate" rel="tag">NHibernate</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=TINjYrmFWqY:cO7PjbrRW1M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=TINjYrmFWqY:cO7PjbrRW1M:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=TINjYrmFWqY:cO7PjbrRW1M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=TINjYrmFWqY:cO7PjbrRW1M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=TINjYrmFWqY:cO7PjbrRW1M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=TINjYrmFWqY:cO7PjbrRW1M:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/TINjYrmFWqY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/03/09/power-of-hql-condition-on-a-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/03/09/power-of-hql-condition-on-a-collection/</feedburner:origLink></item>
		<item>
		<title>PopupControlExtender set focus to a control on popup</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/IebRpUomae4/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/03/05/popupcontrolextender-set-focus-to-a-control-on-popup/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 16:35:21 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft Ajax]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/03/05/popupcontrolextender-set-focus-to-a-control-on-popup/</guid>
		<description><![CDATA[
			
				
			
		
I have a project with a complex user control used to select some values in hierarchic categories, it was realized with the UpdatePanel, it supports searching, selection by cascade of combo and much more, everything works great, but performances are not so good.
Now I decide to create another version that use jQuery to do real [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F03%2F05%2Fpopupcontrolextender-set-focus-to-a-control-on-popup%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F03%2F05%2Fpopupcontrolextender-set-focus-to-a-control-on-popup%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have a project with a complex user control used to select some values in hierarchic categories, it was realized with the UpdatePanel, it supports searching, selection by cascade of combo and much more, everything works great, but performances are not so good.</p>
<p>Now I decide to create another version that use jQuery to do real ajax calls and manage json data to maximize performances, but I face a problem</p>
<ul>
<li>I need to create a UserControl. </li>
<li>I can have more than one instance of this user control in a single page (but I want a single jquery script) </li>
<li>The user want to move the focus on a specific part of my control when the popup opens. </li>
</ul>
<p>This is an interesting problem, because the popup logic is done with the <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PopupControl/PopupControl.aspx">PopupControlExtender</a> and I do not want to change it. My goal is to be able to execute some jQuery code when the popup appears and move the focus on a control contained in the popup. Since Microsoft Ajax library, used by the PCE, creates a client side javascript object for each PopupControlExtender, my first problem is “how can I select the javascript object that correspond to my server side control, when I can have more than one instance of the user control in the page (this means multiple PCE)? </p>
<p>If you know the microsoft ajax library you already know the <a href="http://www.asp.net/AJAX/Documentation/Live/ClientReference/Global/FindShortcutMethod.aspx">$find()</a> function, and you should know also that you can use a particular property called BehaviorID to give a unique Id to the client part of a component. A partial solution to my problem <a href="http://forums.asp.net/t/1440825.aspx">can be found here</a> (look in the end of the post). In that post the PopupControlExtender was declared in this way</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> &lt;AjaxControlToolkit:PopupControlExtender ID=<span style="color: #006080">&quot;TextBox1_PopupControlExtender&quot;</span> BehaviorID=<span style="color: #006080">&quot;pce&quot;</span> runat=<span style="color: #006080">&quot;server&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="lnum2">   2:</span>       TargetControlID=<span style="color: #006080">&quot;tbPrompt&quot;</span> PopupControlID=<span style="color: #006080">&quot;popupPanel&quot;</span> Position=<span style="color: #006080">&quot;Bottom&quot;</span>&gt;  </pre>
<p><!--CRLF--></div>
</div>
<p><em>As you can see the BehaviorID property is set to “pce”.</em> Now you can write this client side javascript 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: #0000ff">function</span> pageLoad() {   </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: #008000">//find the PopupControlExtender's client behavior   </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: #0000ff">var</span> pce = $find(<span style="color: #006080">&quot;pce&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="lnum4">   4:</span>            <span style="color: #008000">//add the shown event handler   </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>            pce.add_shown(pceShownHandler);   </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>  </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>        <span style="color: #0000ff">function</span> pceShownHandler(sender, args) {   </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: #0000ff">var</span> pce = $find(<span style="color: #006080">&quot;pce&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="lnum10">  10:</span>            <span style="color: #008000">//find the popup Panel of the PopupControlExtender   </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>            <span style="color: #0000ff">var</span> popup = pce._popupElement;   </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">var</span> input = popup.getElementsByTagName(<span style="color: #006080">&quot;input&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="lnum13">  13:</span>            <span style="color: #0000ff">for</span> (i = 0; i &lt; input.length; i++) {   </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">// To check whether the TextBox is the &quot;setFocusToMeOnPopup&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="lnum15">  15:</span>                <span style="color: #008000">// This is just a sample, please modify this condition yourself.   </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>                <span style="color: #0000ff">if</span> (input[i].id == <span style="color: #006080">&quot;FocusTextBox1_setFocusToMeOnPopup&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="lnum17">  17:</span>                    input[i].focus();   </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>                    input[i].select();   </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>                }   </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>As you can verify from line3,<em> the $find(“pce”) finds the javascript object that contains the client side scripting function of the PopupControlExtender</em>, so you can use the <strong>add_shown</strong> method <em>to register a client side script to execute when the popup opens</em>. If I use the same technique, when I drop two instance of my usercontrol in the page I obtain this javascript error.</p>
<blockquote>
<p><strong><em>Error: Sys.InvalidOperationException: Two components with the same id &#8216;pce&#8217; can&#8217;t be added to the application.</em></strong></p>
</blockquote>
<p>The reason is that BehaviorID must be unique in the page. The solution is quite simple, first of all I insert this function in the jQuery script.</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">function</span> pceShownHandler(sender, args) {</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">var</span> txtControl = sender._parentElement;</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>     $(txtControl).parents(<span style="color: #006080">'.hierarchicmaindiv'</span>).find(<span style="color: #006080">'#txtSearch'</span>).focus();</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> }</pre>
<p><!--CRLF--></div>
</div>
<p>This is the function I want to register with the <strong>add_shown</strong> method, it simply get the textbox control with the _parentElement field of the pce object, then it is time of some magical jQuery selector. <em>Each of my usercontrol instance is rendered inside a div with the class hierarchicmaindiv</em>, now I want to find the textbox wiht “txtSearch” id, but I want only the one related to the specific popup. </p>
<p>To reach this goal we need to find the containing div with the parents jQuery function, then with find() function we look for a textbox with the “txtSearch” id but that is also contained in the div. With this little trick I’m sure that you can drop multiple instance of the control in the page without any problem because when the popup opens, I can find the txtSearch textbox inside the popup even when there are multiple txtSearch textbox in the whole page. </p>
<p>Now I need to wireup this function to the <strong>add_shown</strong> method of the popupcontrolextender, and this can be obtained with this little snippet on the PreRender server events of the UserControl</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> hierarchicPce.BehaviorID = Guid.NewGuid.ToString()</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>&#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="lnum3">   3:</span> <span style="color: #0000ff">Dim</span> script <span style="color: #0000ff">As</span> <span style="color: #0000ff">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: #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: #006080">&quot;Sys.Application.add_load(function() {&quot;</span> &amp; _</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: #006080">&quot;var pce = $find('&quot;</span> &amp; hierarchicPce.BehaviorID &amp; <span style="color: #006080">&quot;');&quot;</span> &amp; _</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: #006080">&quot;pce.add_shown(pceShownHandler);&quot;</span> &amp; _</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: #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: #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> Page.ClientScript.RegisterStartupScript(<span style="color: #0000ff">Me</span>.<span style="color: #0000ff">GetType</span>(), hierarchicPce.BehaviorID, script, <span style="color: #0000ff">True</span>)</pre>
<p><!--CRLF--></div>
</div>
<p>To avoid duplication of BehaviorID I use a guid, then I create a stupid and little script that uses Sys.Application.add_load() method of Microsoft Ajax library&#160; to register a couple of javascript lines of code <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , the first finds the PopupControlExtender client side object using the guid assigned to BehaviorId and the second one cals the add_shown function to register the function to give focus to correct control.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/asp.net" rel="tag">asp.net</a> <a href="http://technorati.com/tag/Microsoft Ajax" rel="tag">Microsoft Ajax</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=IebRpUomae4:-6j159KurzY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=IebRpUomae4:-6j159KurzY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=IebRpUomae4:-6j159KurzY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=IebRpUomae4:-6j159KurzY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=IebRpUomae4:-6j159KurzY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=IebRpUomae4:-6j159KurzY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/IebRpUomae4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/03/05/popupcontrolextender-set-focus-to-a-control-on-popup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/03/05/popupcontrolextender-set-focus-to-a-control-on-popup/</feedburner:origLink></item>
		<item>
		<title>Lab Management VDH Up and running</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/thomz3NU9hs/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/02/27/lab-management-vdh-up-and-running/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 08:20:00 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Lab Management]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/02/27/lab-management-vdh-up-and-running/</guid>
		<description><![CDATA[
			
				
			
		
With VS2010 RC MS had released a vhd to evaluate Lab Management. This is a very good news, and since I already have a Beta2 Lab Management Up and running I want to try the VHD to see what is improved on RC.
Lab Management is and environment, so there is not a way you can [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F27%2Flab-management-vdh-up-and-running%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F27%2Flab-management-vdh-up-and-running%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>With VS2010 RC MS had released a <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=592e874d-8fcd-4665-8e55-7da0d44b0dee&amp;displaylang=en">vhd to evaluate Lab Management</a>. This is a very good news, and since I already have a Beta2 Lab Management Up and running I want to try the VHD to see what is improved on RC.</p>
<p>Lab Management is and environment, so there is not a way you can simply launch the vhd and play with it, you absolutely need to setup an environment and follow <a href="http://blogs.msdn.com/lab_management/archive/2010/02/12/one-box-lab-management-walkthrough.aspx">this detailed tutorial</a>. The first problem is, “How I can evaluate lab management without disturbing my main system?”.</p>
<p>The easiest way if you have windows 7 (And you should <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) is <a href="http://blogs.technet.com/aviraj/archive/2009/01/18/windows-7-boot-from-vhd-first-impression-part-2.aspx">sysprepping a vhd</a> with an image of windows server 2008 R2 (I choosed enterprise), then follow <a href="http://blogs.technet.com/aviraj/archive/2009/01/18/windows-7-boot-from-vhd-first-impression-part-2.aspx">instructions by Scott</a> to boot from vhd and the game is done. You have a dual boot without disturbing the main system, without partitioning etc etc.</p>
<p>Once you boot from vhd the sysprepped image will finish to install the operating system, then you can install hyper-v role and begin the installation of Lab Management <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  how cool.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Lab Management." rel="tag">Lab Management.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=thomz3NU9hs:iCvFB_zuHXk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=thomz3NU9hs:iCvFB_zuHXk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=thomz3NU9hs:iCvFB_zuHXk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=thomz3NU9hs:iCvFB_zuHXk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=thomz3NU9hs:iCvFB_zuHXk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=thomz3NU9hs:iCvFB_zuHXk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/thomz3NU9hs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/02/27/lab-management-vdh-up-and-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/02/27/lab-management-vdh-up-and-running/</feedburner:origLink></item>
		<item>
		<title>Work with castle and NHibernate trunk</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/oe8pADBf1vw/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/02/26/work-with-castle-and-nhibernate-trunk/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 17:37:56 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Castle]]></category>
		<category><![CDATA[Nhibernate]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/02/26/work-with-castle-and-nhibernate-trunk/</guid>
		<description><![CDATA[
			
				
			
		
Working with open source software is fun, but sometimes can be difficult. Take as example castle and Nhibernate, since castle references nh with the NHIntegration facility, and at the same time NH references castle for Dynamic Proxy.
A good way to survive this chaos, is working with the trunk, as I usually do, but compiling everything [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F26%2Fwork-with-castle-and-nhibernate-trunk%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F26%2Fwork-with-castle-and-nhibernate-trunk%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Working with open source software is fun, but sometimes can be difficult. Take as example castle and Nhibernate, since castle references nh with the NHIntegration facility, and at the same time NH references castle for Dynamic Proxy.</p>
<p>A good way to survive this chaos, is working with the trunk, as I usually do, but compiling everything can be quite complex, but we are lucky because we have a project called <a href="http://github.com/dagda1/horn_src">Horn</a> that does everything for you.</p>
<p>First of all you need to install <a href="http://code.google.com/p/msysgit/downloads/list">nsysgit</a> first of all you need to grab the latest source of horn with the comand “git clone <a title="git://github.com/dagda1/horn_src.git" href="git://github.com/dagda1/horn_src.git">git://github.com/dagda1/horn_src.git</a>”. Once you get the source, you need to modify a source file called /src/horn.console/program.cs, in this file there is a function called GetRootFolderPath that ends with a line like</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> var ret = <span style="color: #0000ff">new</span> DirectoryInfo(rootFolder);</pre>
<p><!--CRLF--></div>
</div>
<p>This line needs to be modified with the following line</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> var ret = <span style="color: #0000ff">new</span> DirectoryInfo(@&quot;d:\osdevelop\horn_src\&quot; + PackageTree.RootPackageTreeName);</pre>
<p><!--CRLF--></div>
</div>
<p>clearly the D:\osdevelop\horn_src is my physical path where git extracted horn source code. Now you can go project root and run the HornBuild.bat. If the compilation is successful the horn library was compiled correctly, so you can go to /src/build/net-3.5/debug and you should find a program called horn.exe. Go to this location with a command line and type </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> horn -install:castle.facilities.nhibernateintegration</pre>
<p><!--CRLF--></div>
</div>
<p>with this command horn try to build everything needed for castle facilities nhibernate integration, so horn contacts all various repositories of all the needed libraries, it downloads the latest source and compiles everything. IF everything is gone good, you can simply go to the directory .horn\result and find all the dll’s <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  without worrying about order of compilation, source repositories etc etc.</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/NHibernate" rel="tag">NHibernate</a> </p>
<p>Tags: <a href="http://technorati.com/tag/Castle" rel="tag">Castle</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oe8pADBf1vw:C2WWh3zeF7w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oe8pADBf1vw:C2WWh3zeF7w:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oe8pADBf1vw:C2WWh3zeF7w:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=oe8pADBf1vw:C2WWh3zeF7w:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oe8pADBf1vw:C2WWh3zeF7w:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oe8pADBf1vw:C2WWh3zeF7w:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/oe8pADBf1vw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/02/26/work-with-castle-and-nhibernate-trunk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/02/26/work-with-castle-and-nhibernate-trunk/</feedburner:origLink></item>
		<item>
		<title>Writing a custom Activity for TFS 2010 Build workflow</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/_oRqGetDktw/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/02/25/writing-a-custom-activity-for-tfs-2010-build-workflow/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:56:41 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[TFS Build]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/02/25/writing-a-custom-activity-for-tfs-2010-build-workflow/</guid>
		<description><![CDATA[
			
				
			
		
A good option to customize TFS2010 build workflow is creating a Custom Activity, an operation that is quite different from creating a Custom Code Activity. A custom activity does not contain any code at all and it is only composed by sub activities. This kind of customization is really useful to create pieces of workflow [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F25%2Fwriting-a-custom-activity-for-tfs-2010-build-workflow%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F25%2Fwriting-a-custom-activity-for-tfs-2010-build-workflow%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A good option to customize TFS2010 build workflow is creating a Custom Activity, an operation that is quite different from creating a Custom <strong>Code</strong> Activity. A custom activity does not contain any code at all and it is only composed by sub activities. This kind of customization is really useful to create pieces of workflow that will be inserted in main build workflow. As an example I created a simple custom activity to deploy a database project on a custom Database Server.</p>
<p>The overall operation was already covered <a href="http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/">in this post</a>, but as you can see that technique involved a MsBuild Activity and you needed to specify values with a really bad “command line parameter” syntax.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Immagine1" border="0" alt="Immagine1" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine1_thumb.png" width="759" height="403" /></a> </p>
<p>Specifying parameter with this technique is awkward and error prone. To solve this situation you can simply create a custom activity. Once you created it, you need to go to “Arguments” tab and insert all the input and output parameters you need.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Immagine2" border="0" alt="Immagine2" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine2_thumb.png" width="615" height="297" /></a> </p>
<p>With this approach, you can use default value for arguments, and you can specify the exact type for arguments, so the workflow can do type checking against the input arguments. I’ve inserted all the input parameters I need: database name, server name, dbProjectname etc etc. Inside the Activity I simply drop a sequence and inside the sequence all the actions needed to deploy the database. The exact technique is described in my old post, the only remarkable difference is logging, because now I can directly drop a WriteBuildMessage activity inside the sequence to log messages. Here is the final activity</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Immagine3" border="0" alt="Immagine3" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine3_thumb.png" width="318" height="472" /></a> </p>
<p>Once you have compiled this, you can insert in the build workflow. The great advantage of this approach is that you are now able to specify parameters with great easy.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Immagine4" border="0" alt="Immagine4" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/Immagine4_thumb.png" width="791" height="328" /></a> </p>
<p>Compare this with the original approach, where you needed to insert the string </p>
<p><em>&quot;/p:TargetDatabase=NorthwindTest&quot; +      <br />&quot; /p:&quot;&quot;DefaultDataPath=C:Program FilesMicrosoft SQL ServerMSSQL10.SQL2008MSSQLDATA&quot;&quot;&quot; +       <br />&quot; /p:&quot;&quot;TargetConnectionString=Data Source=10.0.0.99SQL2008,49400%3Buser=sa%3Bpwd=Pa$$w0rd&quot;&quot;&quot; +       <br />&quot; /p:DeployToDatabase=true&quot;</em></p>
<p> Directly inside the CommandLineArgument of MsBuild activity. Now each parameter can be specified alone, and the whole action is much more readable.
<p>Clearly the output result is exactly the same as before, because under the hood it is composed by exactly the same sequence of actions, but now they are all wrapped inside a single Activity, making the workflow more readable.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Team Foundation Server" rel="tag">Team Foundation Server</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=_oRqGetDktw:_3CoN0XwtWo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=_oRqGetDktw:_3CoN0XwtWo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=_oRqGetDktw:_3CoN0XwtWo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=_oRqGetDktw:_3CoN0XwtWo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=_oRqGetDktw:_3CoN0XwtWo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=_oRqGetDktw:_3CoN0XwtWo:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/_oRqGetDktw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/02/25/writing-a-custom-activity-for-tfs-2010-build-workflow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/02/25/writing-a-custom-activity-for-tfs-2010-build-workflow/</feedburner:origLink></item>
		<item>
		<title>Three state checkbox in asp.net</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/qtN4cTPwToI/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/02/02/three-state-checkbox-in-asp-net/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 09:11:49 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/02/02/three-state-checkbox-in-asp-net/</guid>
		<description><![CDATA[
			
				
			
		
Yesterday I need to implement in a quick way a three style checkbox in a project based on asp.net 3.5. The requirements stated that I must not spend too much time designing an entire new control, but the solution should be usable by other people with minimum impact. Here is the result I obtained.

The checkbox [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F02%2Fthree-state-checkbox-in-asp-net%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F02%2F02%2Fthree-state-checkbox-in-asp-net%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Yesterday I need to implement in a quick way a three style checkbox in a project based on asp.net 3.5. The requirements stated that I must not spend too much time designing an entire new control, but the solution should be usable by other people with minimum impact. Here is the result I obtained.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/02/image_thumb.png" width="294" height="61" /></a></p>
<p>The checkbox can be, selected, not selected, or not used and when it is not used it is blue, like the one in windows forms. This was needed to satisfy a requirement, I need to make possible for the user to specify complex filters, and I have boolean fields on my entities where the user can ask for: filter only the one with field==true or field==false or no filter for that field. To achieve the result you can simply use a standard checkbox. </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">&lt;</span><span style="color: #800000">asp:CheckBox</span> <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;chkCCSignaled&quot;</span> <span style="color: #ff0000">CssClass</span><span style="color: #0000ff">=&quot;threestate&quot;</span> <span style="color: #ff0000">runat</span><span style="color: #0000ff">=&quot;server&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>The only stuff you need is that you need to assign the “threestate” style to the checkbox. (this satisfy the need of the minimuym impact, other developers that want to use that checkbox can simply add that css to a standard checkbox). The dirty work is done by an unobtrusive jquery javascript that gets injected with the masterpage.</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">function</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: #006080">'span.threestate'</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>         .log(<span style="color: #006080">'checkboxes'</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>         .each(<span style="color: #0000ff">function</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>             <span style="color: #0000ff">var</span> thespan = $(<span style="color: #0000ff">this</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>             <span style="color: #0000ff">var</span> checkbox = $(thespan.children().get(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="lnum7">   7:</span>             <span style="color: #0000ff">var</span> name = checkbox.attr(<span style="color: #006080">'id'</span>) + <span style="color: #006080">'_hf'</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: #0000ff">var</span> innerhf = $(<span style="color: #006080">'&lt;input type=&quot;hidden&quot; name=&quot;'</span> + name + <span style="color: #006080">'&quot; id=&quot;'</span> + name + <span style="color: #006080">'&quot; /&gt;'</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>             thespan.prepend(innerhf);</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>             <span style="color: #0000ff">var</span> innerslide = $(<span style="color: #006080">'&lt;div style=&quot;width:'</span> + thespan.width() + <span style="color: #006080">'px; height:'</span> + thespan.height() + <span style="color: #006080">'px&quot; class=&quot;chboverlay&quot; /&gt;'</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>             .css(<span style="color: #006080">'opacity'</span>, 0.8)</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>                 .click(<span style="color: #0000ff">function</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: #008000">//debugger;</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>                     <span style="color: #0000ff">if</span> (innerhf.val() == 2) {</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">this</span>).css(<span style="color: #006080">'opacity'</span>, 0.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: #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>                         checkbox.attr(<span style="color: #006080">'checked'</span>, <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="lnum19">  19:</span>                         innerhf.val(1);</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>                     } <span style="color: #0000ff">else</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>                         <span style="color: #0000ff">if</span> (innerhf.val() == 1) {</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>                             checkbox.attr(<span style="color: #006080">'checked'</span>, <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: 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>                             innerhf.val(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: #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: #0000ff">else</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>                             $(<span style="color: #0000ff">this</span>).css(<span style="color: #006080">'opacity'</span>, 0.8)</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>                             checkbox.attr(<span style="color: #006080">'checked'</span>, <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: 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>                             innerhf.val(2);</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>                         }</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>                     }</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>                 });</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">var</span> chkvalue = <span style="color: #006080">&quot;2&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="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: #0000ff">if</span> (checkbox.parent().attr(<span style="color: #006080">'threestatevalue'</span>) != undefined) {</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>                 chkvalue = checkbox.parent().attr(<span style="color: #006080">'threestatevalue'</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>                 <span style="color: #0000ff">if</span> (chkvalue == <span style="color: #006080">&quot;0&quot;</span> || chkvalue == <span style="color: #006080">&quot;1&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>                     innerslide.css(<span style="color: #006080">'opacity'</span>, 0.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="lnum37">  37:</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>             innerhf.val(chkvalue);</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>             thespan.prepend(innerslide);</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>         });</pre>
<p><!--CRLF--></div>
</div>
<p>The solution is quite simple, I create a new div with a specific class to overlay the checkbox and create the blue layer when the checkbox is in state “undefined”. the tricky part is that I need to manage three possible value for the checkbox and I need to pass that value to the server during a postback, so I create dynamically an hidden input with the same id of the checkbox and the “_hf” string at the end. In that hidden field I store the actual value of the checkbox, 0 not selected, 1 selected and 2 undefined. The rest of the script is needed to manage the transition between states reacting to the click event of the checkbox.</p>
<p>In the server code I need to grab the three state value, so I created a simple extension method.</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> SiteCode.V2</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">Public</span> <span style="color: #0000ff">Module</span> ThreeStateCheckbox</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>&#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="lnum4">   4:</span>         &lt;Extension()&gt; _</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">Public</span> <span style="color: #0000ff">Function</span> GetThreeStateValue(<span style="color: #0000ff">ByVal</span> cb <span style="color: #0000ff">As</span> CheckBox) <span style="color: #0000ff">As</span> Nullable(Of <span style="color: #0000ff">Boolean</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>             <span style="color: #0000ff">Dim</span> value <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span> = HttpContext.Current.Request.Form(cb.ClientID + <span style="color: #006080">&quot;_hf&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="lnum7">   7:</span>             cb.Attributes(<span style="color: #006080">&quot;threestatevalue&quot;</span>) = value</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>             <span style="color: #0000ff">Select</span> <span style="color: #0000ff">Case</span> value</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: #0000ff">Case</span> <span style="color: #006080">&quot;0&quot;</span> : <span style="color: #0000ff">Return</span> <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="lnum10">  10:</span>                 <span style="color: #0000ff">Case</span> <span style="color: #006080">&quot;1&quot;</span> : <span style="color: #0000ff">Return</span> <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="lnum11">  11:</span>                 <span style="color: #0000ff">Case</span> <span style="color: #006080">&quot;2&quot;</span> : <span style="color: #0000ff">Return</span> <span style="color: #0000ff">Nothing</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">End</span> <span style="color: #0000ff">Select</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>&#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>         <span style="color: #0000ff">End</span> <span style="color: #0000ff">Function</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">End</span> <span style="color: #0000ff">Module</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> <span style="color: #0000ff">End</span> Namespace</pre>
<p><!--CRLF--></div>
</div>
<p>This simple method is an extension method for the checkbox control, it simply grab the value of the dynamically generated hidden field from the Request.Form collection. After taking actual value, he add the attribute “threestatevalue” to the checkbox, because the client script should be able to restore the state of the checkbox after a postback. Now you can simply get the value with this 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: #0000ff">Public</span> <span style="color: #0000ff">ReadOnly</span> <span style="color: #0000ff">Property</span> IsCCChecked() <span style="color: #0000ff">As</span> Nullable(Of <span style="color: #0000ff">Boolean</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">Get</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: #0000ff">Return</span> chkCC.GetThreeStateValue()</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">End</span> <span style="color: #0000ff">Get</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> <span style="color: #0000ff">End</span> Property</pre>
<p><!--CRLF--></div>
</div>
<p>With this structure the developer can simply add the css (as seen before) and use this extension method to grab the value, this without the need to author a whole new control.</p>
<p>I used this in a user control (that represents a complex filter and gets used in several pages), and this user control exposes the selection status to external control with readonly property that return Nullable(of Boolean). Thanks to extension method I can simply add the css to the checkbox, use GetThreeStateValue to grab the actual status of the checkbox and the game is done.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/asp.net" rel="tag">asp.net</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=qtN4cTPwToI:4jxKNs9LZaE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=qtN4cTPwToI:4jxKNs9LZaE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=qtN4cTPwToI:4jxKNs9LZaE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=qtN4cTPwToI:4jxKNs9LZaE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=qtN4cTPwToI:4jxKNs9LZaE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=qtN4cTPwToI:4jxKNs9LZaE:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/qtN4cTPwToI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/02/02/three-state-checkbox-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/02/02/three-state-checkbox-in-asp-net/</feedburner:origLink></item>
		<item>
		<title>Facebook profile “The page you requested was not found” Fix</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/YMhrwaZVqD8/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/27/facebook-profile-the-page-you-requested-was-not-found-fix/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 14:13:08 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/27/facebook-the-page-you-requested-was-not-found-on-your-profile/</guid>
		<description><![CDATA[
			
				
			
		
Sometimes I wonder the reason of some strange error in really big application. Facebook is surely one of the biggest application on the planet, it manages millions of user, but it has strange bug. I use facebook rarely, but in the last few days I was not able to look at my profile, whenever I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F27%2Ffacebook-profile-the-page-you-requested-was-not-found-fix%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F27%2Ffacebook-profile-the-page-you-requested-was-not-found-fix%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes I wonder the reason of some strange error in really big application. Facebook is surely one of the biggest application on the planet, it manages millions of user, but it has strange bug. I use facebook rarely, but in the last few days I was not able to look at my profile, whenever I click on “PRofile” I got this.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image41.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb41.png" width="643" height="329" /></a> </p>
<p>It happens with every browser, and I wonder what is happened to my profile. Apparently, after few days, I found a link somewhere that told me how to solve this problem, simply change the language to some other languate and then come back to the original one.</p>
<p>As an example, click on “English (US)” and choose “English (UK)”, the problem is still there, profile does not work, but now, if you change back to “English (US)” again, the problem disappeared.</p>
<p>&#160;<a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image42.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb42.png" width="567" height="435" /></a> </p>
<p>And you have to repeat this one for each browser you had, suppose you fix in IE, then you go to Chrome, and the problem is still there, you need to change language and back to the original one in each browser <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>It is even more strange because it continue to happens, after half an hour, my profile disappeared again, and I need again to do the change language trick.</p>
<p>I wonder what is the real problem behind this <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>alk.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=YMhrwaZVqD8:Mm2Zv357wcU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=YMhrwaZVqD8:Mm2Zv357wcU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=YMhrwaZVqD8:Mm2Zv357wcU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=YMhrwaZVqD8:Mm2Zv357wcU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=YMhrwaZVqD8:Mm2Zv357wcU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=YMhrwaZVqD8:Mm2Zv357wcU:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/YMhrwaZVqD8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/27/facebook-profile-the-page-you-requested-was-not-found-fix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/27/facebook-profile-the-page-you-requested-was-not-found-fix/</feedburner:origLink></item>
		<item>
		<title>Run test with TypeMockIsolator during a tfs2010 build</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/2jyL9ZleCiM/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/27/run-test-with-typemockisolator-during-a-tfs2010-build/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 10:58:19 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[TFS Build]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/27/run-test-with-typemockisolator-during-a-tfs2010-build/</guid>
		<description><![CDATA[
			
				
			
		
TypeMock Isolator is a good library to inject mock objects without the need of interfaces, but what happens when you try to run test that uses typemock isolator inside a tfs 2010 build? Clearly the tests will not succeed
&#160; 
If you look at test result you can check why the tests are failing
 
Ok, the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F27%2Frun-test-with-typemockisolator-during-a-tfs2010-build%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F27%2Frun-test-with-typemockisolator-during-a-tfs2010-build%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://site.typemock.com/">TypeMock Isolator</a> is a good library to inject mock objects without the need of interfaces, but what happens when you try to run test that uses typemock isolator inside a tfs 2010 build? Clearly the tests will not succeed</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image34.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb34.png" width="456" height="207" /></a>&#160; </p>
<p>If you look at test result you can check why the tests are failing</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image35.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb35.png" width="406" height="235" /></a> </p>
<p>Ok, the error is really clear, to run typemock tests, you need to run mstest with the tmockrunner.exe test runner that gets installed with typemock. To solve this problem create a custom activity like this one.</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">using</span> System;</pre>
<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">using</span> System.Collections.Generic;</pre>
<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">using</span> System.Linq;</pre>
<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.Text;</pre>
<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.Activities;</pre>
<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: #0000ff">using</span> System.IO;</pre>
<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">using</span> System.Diagnostics;</pre>
<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>
<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: #0000ff">namespace</span> DotNetMarche.Activities</pre>
<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> {</pre>
<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>
<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">public</span> <span style="color: #0000ff">sealed</span> <span style="color: #0000ff">class</span> ExternalTestRunner : CodeActivity&lt;Int32&gt;</pre>
<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>
<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">// Define an activity input argument of type string</span></pre>
<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">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; TestRunnerExecutable { get; set; }</pre>
<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>
<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">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; TestAssemblyName { get; set; }</pre>
<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>&#160; </pre>
<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>         <span style="color: #0000ff">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; MsTestExecutable { get; set; }</pre>
<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>&#160; </pre>
<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>         <span style="color: #0000ff">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; ProjectCollection { get; set; }</pre>
<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>
<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>         <span style="color: #0000ff">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; BuildNumber { get; set; }</pre>
<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>&#160; </pre>
<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>         <span style="color: #0000ff">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; TeamProjectName { get; set; }</pre>
<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>&#160; </pre>
<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">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; Platform { get; set; }</pre>
<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>
<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>         <span style="color: #0000ff">public</span> InArgument&lt;<span style="color: #0000ff">string</span>&gt; Flavor { get; set; }</pre>
<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>
<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>&#160; </pre>
<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>         <span style="color: #008000">// If your activity returns a value, derive from CodeActivity&lt;TResult&gt;</span></pre>
<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">// and return the value from the Execute method.</span></pre>
<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: #0000ff">protected</span> <span style="color: #0000ff">override</span> Int32 Execute(CodeActivityContext context)</pre>
<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>         {</pre>
<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>             </pre>
<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>             String mstest = MsTestExecutable.Get(context);</pre>
<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>             <span style="color: #0000ff">if</span> (<span style="color: #0000ff">string</span>.IsNullOrEmpty(mstest))</pre>
<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>                 mstest = <span style="color: #006080">@&quot;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE&quot;</span>;</pre>
<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>             <span style="color: #0000ff">if</span> (!mstest.EndsWith(<span style="color: #006080">&quot;.exe&quot;</span>))</pre>
<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>                 mstest = Path.Combine(mstest + <span style="color: #006080">&quot;mstest.exe&quot;</span>);</pre>
<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>             String testrunner = TestRunnerExecutable.Get(context);</pre>
<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>             String arguments = String.Format(</pre>
<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: #006080">@&quot;&quot;</span><span style="color: #006080">&quot;{6}&quot;</span><span style="color: #006080">&quot; /nologo /testcontainer:&quot;</span><span style="color: #006080">&quot;{0}&quot;</span><span style="color: #006080">&quot; /publish:&quot;</span><span style="color: #006080">&quot;{1}&quot;</span><span style="color: #006080">&quot; /publishbuild:&quot;</span><span style="color: #006080">&quot;{2}&quot;</span><span style="color: #006080">&quot; /teamproject:{3} /platform:&quot;</span><span style="color: #006080">&quot;{4}&quot;</span><span style="color: #006080">&quot; /flavor:&quot;</span><span style="color: #006080">&quot;{5}&quot;</span><span style="color: #006080">&quot; /resultsfile:&quot;</span><span style="color: #006080">&quot;TestResult.trx&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="lnum45">  45:</span>                 TestAssemblyName.Get(context), ProjectCollection.Get(context), </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>                 BuildNumber.Get(context), TeamProjectName.Get(context),</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>                 Platform.Get(context), Flavor.Get(context), mstest);</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>             Utils.LogMessage(<span style="color: #006080">&quot;Call Mstest With Wrapper &quot;</span> + testrunner + <span style="color: #006080">&quot; and arguments &quot;</span> + arguments, context);</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>             <span style="color: #0000ff">using</span> (System.Diagnostics.Process process = <span style="color: #0000ff">new</span> System.Diagnostics.Process())</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>                 process.StartInfo.FileName = testrunner;</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>                 process.StartInfo.WorkingDirectory = Path.GetDirectoryName(TestAssemblyName.Get(context));</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>                 process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;</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>                 process.StartInfo.UseShellExecute = <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: 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>                 process.StartInfo.ErrorDialog = <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="lnum56">  56:</span>                 process.StartInfo.CreateNoWindow = <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="lnum57">  57:</span>                 process.StartInfo.RedirectStandardOutput = <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: #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>                 process.StartInfo.Arguments = arguments;</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>                 process.Start();</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>                 String output = process.StandardOutput.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: 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>&#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="lnum62">  62:</span>                 process.WaitForExit();</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>                 Utils.LogMessage(<span style="color: #006080">&quot;output of ExternalTestRunner:&quot;</span> + output, context);</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="lnum64">  64:</span>                 <span style="color: #0000ff">return</span> process.ExitCode;</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="lnum65">  65:</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="lnum66">  66:</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="lnum67">  67:</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="lnum68">  68:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>This is a really simple activity, and probably it needs more work to go in production, but it can be used as starting point. It simply uses System.Diagnostic.Process to invoke MsTest.exe with TMockRunner.exe wrapper, and thanks to output redirection I’m able to read all the output of the run and log it in the build. </p>
<p>The important aspect is that I return the MsTest exit code from the custom activity, and this is needed to verify test outcome. This is really important because the caller can assign the return value to a variable and check the real Mstest return value, to understand if the tests succeeded.</p>
<p>With this action in hand you need to substitute the standard mstest activity in the workflow. Here is the how I inserted this action for my test project. (locate the section of the workflow that use MsTest activity to run the tests.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image36.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb36.png" width="544" height="645" /></a> </p>
<p>I create a foreach for each string in testAssemblies variable (an enumerable&lt;STring&gt;), that contains all test assembly configured in the build, then for each one I create a sequence where the first action is my new custom action seen before. This action return value (remember that is the return value of mstest) is assigned to a local variable called <strong>TypemockTestResult</strong>, so I can verify if its value is different from zero or 128 (this indicates an error in the test). Any return value different from 0 or 128 means that there was an error running the tests so I can set BuildDetail.TestStatus to fail, informing the whole workflow that test are failed.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image37.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb37.png" width="667" height="165" /></a> </p>
<p>These are all the properties of my custom action. As you can verify the <strong>Result</strong> value is assigned to the TypeMockTestResult, so the workflow can verify the test result.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image38.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb38.png" width="343" height="320" /></a> </p>
<p>Other properties are needed to publish the result in the build. Now I schedule a build with two tests, one use typemock and succeeded, the other use typemock but fails. When I run the build I obtain:</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image39.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb39.png" width="441" height="374" /></a> </p>
<p>As you can see tests are run under TMockRunner.exe and everything is good. I can see test results and the build is partially failed because one of the test failed.</p>
<p>&#160; If you look at the details you can verify how tests were run.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image40.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb40.png" width="436" height="436" /></a> </p>
<p>Thanks to logging I can see all details in the build log. As you can verify I logged all the output of the TMockRunner.exe, so I can verify details of execution.</p>
<p>This example needs more work to be used in production, this because some value like “any CPU” and “Debug” are hardcoded in the action, moreover the custom action does not permits to use a test configuration file, but it can be used as starting point <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/TfsBuild2010" rel="tag">TfsBuild2010</a> <a href="http://technorati.com/tag/TypeMockIsolator" rel="tag">TypeMockIsolator</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=2jyL9ZleCiM:IIWrxwKF2EQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=2jyL9ZleCiM:IIWrxwKF2EQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=2jyL9ZleCiM:IIWrxwKF2EQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=2jyL9ZleCiM:IIWrxwKF2EQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=2jyL9ZleCiM:IIWrxwKF2EQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=2jyL9ZleCiM:IIWrxwKF2EQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/2jyL9ZleCiM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/27/run-test-with-typemockisolator-during-a-tfs2010-build/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/27/run-test-with-typemockisolator-during-a-tfs2010-build/</feedburner:origLink></item>
		<item>
		<title>Be friendly with Web Test</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/G6n_AMTKOZE/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/26/be-friendly-with-web-test/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 14:12:21 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/26/be-friendly-with-web-test/</guid>
		<description><![CDATA[
			
				
			
		
I’m creating some web tests with Visual Studio to test an application in an end-to-end fashion. This is absolutely not a unit test, but I want to be able to launch a series of automatic tests against a web server to verify if the whole site satisfy an initial set of core requirements.
One of this [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F26%2Fbe-friendly-with-web-test%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F26%2Fbe-friendly-with-web-test%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I’m creating some web tests with Visual Studio to test an application in an end-to-end fashion. This is absolutely not a unit test, but I want to be able to launch a series of automatic tests against a web server to verify if the whole site satisfy an initial set of core requirements.</p>
<p>One of this test is used to verify if some filters are passed correctly to the Service Layer, because this is a really core feature, and sometimes it happened that someone changes name of parameters, binding will fail and filters does not work anymore on various pages. One of the test populates a couple of textbox with a date range, I set range between 1/1/1900 and 1/1/1901, and I want to verify that this query returns no records. I admit that this is absolutely a bad way to write a test <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , but I want to be able to “smoke test” the page as quickly as possible. If the page returns no record, the filter was surely passed because I’m sure that there is no record in that text range.</p>
<p>The page is quite complex, so I do not want to test the absence of records looking for the message “your query returns no record”, because if someone changes the message this test will have no meaning. When you do this kind of “end-to-end” test, it is useful to output in the page some debug information that can be used from the test.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image30.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb30.png" width="757" height="32" /></a> </p>
<p>I have a property called TotalResults of the page that contains the total number of records returned, and I decided to output this value with an hidden field. It makes the page bigger, but since the page contains really a lot of data, adding such a simple piece of html does not affects performances. The use of an hidden field, make possible for the web test to put that value in the context of the text, thanks to the HiddenField extraction rule.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image31.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb31.png" width="408" height="126" /></a> </p>
<p>You can see that in the first iteration records returned are 8, then you can scroll down the context to find value in the subsequent iteration. The second request is the one with the filter active</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image32.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb32.png" width="375" height="100" /></a> </p>
<p>And you can easily verify that the value of the TotalResult is zero. Now I can simply insert a rule that look for the test in the response output.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image33.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb33.png" width="366" height="118" /></a> </p>
<p>And look for the text ‘&lt;input name=&quot;dbTotalResult&quot; type=&quot;hidden&quot; value=&quot;0&quot;/&gt;’ in the response of the page.</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Testing" rel="tag">Testing</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=G6n_AMTKOZE:GRR9QSaGzgg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=G6n_AMTKOZE:GRR9QSaGzgg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=G6n_AMTKOZE:GRR9QSaGzgg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=G6n_AMTKOZE:GRR9QSaGzgg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=G6n_AMTKOZE:GRR9QSaGzgg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=G6n_AMTKOZE:GRR9QSaGzgg:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/G6n_AMTKOZE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/26/be-friendly-with-web-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/26/be-friendly-with-web-test/</feedburner:origLink></item>
		<item>
		<title>Wrap a MsBuild Custom task inside a custom action</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/Et7gPcXNVag/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/19/wrap-a-msbuild-custom-task-inside-a-custom-action/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 21:28:00 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[TFS Build]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/19/wrap-a-msbuild-custom-task-inside-a-custom-action/</guid>
		<description><![CDATA[
			
				
			
		
If you have an MSBuild custom task that you want to reuse in a TFS 2010 build workflow, you have two solution. The first is using the MsBuild activity as I described in this post, but this approach has a lot of limitations.
First of all it is clumsy, because you have to pass custom task [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F19%2Fwrap-a-msbuild-custom-task-inside-a-custom-action%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F19%2Fwrap-a-msbuild-custom-task-inside-a-custom-action%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you have an MSBuild custom task that you want to reuse in a TFS 2010 build workflow, you have two solution. The first is using the MsBuild activity as I described in <a href="http://www.codewrecks.com/blog/index.php/2009/11/09/use-msbuild-custom-action-in-tfs2010-build-with-a-custom-project/">this post</a>, but this approach has a lot of limitations.</p>
<p>First of all it is clumsy, because you have to pass custom task parameters as arguments to msbuild, but the worst problem is that you lose the ability to use output properties of the custom task. Suppose you have a TinyUrl custom task, that takes an url as input and gives back the tined version, this custom task has this implementation.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image27.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb27.png" width="720" height="424" /></a> </p>
<p>Now suppose you do not have this source code, so you really need to use the MsBuild Custom Task; if you simply use the MsBuild activity as described in the previous post, how can you grab the TinedUrl output property and pass its value to the workflow engine? </p>
<p>To solve this problem you can use another approach to reuse a Custom MsBuild task in a tfs 2010 build, because you can wrap the task execution in a custom activity. First of all we need to fool the Custom MsBuild Task that it is executing inside MSBuild. A first problem is, how can I intercept the inner calls to Log.LogMessage or Log.LogWarning that are inside the CustomTask and pass them to the workflow engine? The solution is this simple class.</p>
<p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:098fceb6-f01f-4237-bfbf-8728efca7b97" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #0000FF;">class</span><span style="color: #000000;"> WorkflowBuildEngine : IBuildEngine
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> CodeActivityContext Context { </span><span style="color: #0000FF;">get</span><span style="color: #000000;">; </span><span style="color: #0000FF;">set</span><span style="color: #000000;">; }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> WorkflowBuildEngine(CodeActivityContext context)
    {
        Context </span><span style="color: #000000;">=</span><span style="color: #000000;"> context;
    }

   ...

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> LogErrorEvent(BuildErrorEventArgs e)
    {
        Utils.LogError(e.Message, Context);
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> LogMessageEvent(BuildMessageEventArgs e)
    {
        Utils.LogMessage(e.Message, Context, BuildMessageImportance.Normal);
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> LogWarningEvent(BuildWarningEventArgs e)
    {
        Utils.LogWarning(e.Message, Context);
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> ProjectFileOfTaskNode
    {
        </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> NotImplementedException(); }
    }
</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>It Implements IBuildEngine, its constructor requires a CodeActivityContext that is used inside the LogErrorEvent, LogMessageEvent and LogWarningEvent methods to forward log message issued by the custom task to the workflow engine. In this way every log that takes place inside the MsBuild custom Action gets forwarded into the workflow engine. Finally you need to create the TinyUrl custom activity that wraps the custom MsBuild task:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:34be513e-09c8-43cb-9f9f-776f7e89f8bc" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">sealed</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> TinyUrl : CodeActivity</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">String</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
{
    [RequiredArgument]
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> InArgument</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> Url { </span><span style="color: #0000FF;">get</span><span style="color: #000000;">; </span><span style="color: #0000FF;">set</span><span style="color: #000000;">; }

      </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> String Execute(CodeActivityContext context)
    {
        TinyUrlTask wrappedTask </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> TinyUrlTask();
        WorkflowBuildEngine engine </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> WorkflowBuildEngine(context);
        wrappedTask.BuildEngine </span><span style="color: #000000;">=</span><span style="color: #000000;"> engine;
        wrappedTask.Url </span><span style="color: #000000;">=</span><span style="color: #000000;"> Url.Get(context);
        </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">wrappedTask.Execute())
        {
            Utils.LogError(</span><span style="color: #800000;">"</span><span style="color: #800000;">Tiny url task failed</span><span style="color: #800000;">"</span><span style="color: #000000;">, context);
        }
       </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> wrappedTask.TinedUrl;
    }
}</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>The first important aspect is that it inherits from CodeActivity&lt;String&gt; instead from a simple CodeActivity, this because this activity will return a string (the tined url) so the type parameter instruct the workflow on the return type of the action. The execute is different too because it should return the result of the action. As you can see the first operation is creating the MsBuild custom task and a WorkflowBuildEngine that gets assigned to the BuildEngine property of the task. After the Engine is ok, you need to populate all the input properties of the MsBuild Custom task, and then call execute.</p>
<p>If the return value of execute is false the action logs the error (so the build <a href="http://www.codewrecks.com/blog/index.php/2010/01/18/log-warning-and-errors-in-a-custom-action/">partially fails</a>) and finally returns the value to the caller because output properties of MsBuild custom Tasks are simple properties, so the tined url is in the TinedUrl property of the task. The good part of this technique is that you can use this action from the graphical designer.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image28.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb28.png" width="644" height="286" /></a> </p>
<p>If you compare with the <a href="http://www.codewrecks.com/blog/index.php/2009/11/09/use-msbuild-custom-action-in-tfs2010-build-with-a-custom-project/">approach that uses MsBuild Activity</a> you have several advantages. First you can use the graphical designer, then you can edit the property with the full editor of workflow foundation and finally you can use output properties. I inserted a WriteBuildMessage after the TinyUrl Custom Activity to verify if the TinedUrl property is correctly set by the action. If you run the build you can verify that everything is good.&#160; I placed two TinyUrl custom activity inside the workflow, the second one tiny the url <a href="http://www.c.com">www.c.com</a>, just to trigger the warning inside the MsBuild custom Task.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image29.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb29.png" width="591" height="222" /></a> </p>
<p>If you look at the first picture of this post, you can verify that the warning “There is no need to tiny the url because is less than 20 chars” is a warning issued internally by the custom MsBuild task, and you are looking at it thanks to the WorkwlofBuildEngine class that forward MsBuild log calls to workflow environment.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/tfs" rel="tag">tfs</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Et7gPcXNVag:wOknxC9vP14:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Et7gPcXNVag:wOknxC9vP14:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Et7gPcXNVag:wOknxC9vP14:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=Et7gPcXNVag:wOknxC9vP14:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Et7gPcXNVag:wOknxC9vP14:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Et7gPcXNVag:wOknxC9vP14:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/Et7gPcXNVag" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/19/wrap-a-msbuild-custom-task-inside-a-custom-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/19/wrap-a-msbuild-custom-task-inside-a-custom-action/</feedburner:origLink></item>
		<item>
		<title>Log warning and errors in a custom action</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/glXGT7ULiig/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/18/log-warning-and-errors-in-a-custom-action/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 20:38:52 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[TFS Build]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/18/log-warning-and-errors-in-a-custom-action/</guid>
		<description><![CDATA[
			
				
			
		
Some time ago I blogged about logging in custom action for TFS build 2010, I left out some details. Suppose you want to create a warning or an error and not a simple message, you need to create a specialized version of the LogWarning that logs a real warning.
 
You can do the same with [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F18%2Flog-warning-and-errors-in-a-custom-action%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F18%2Flog-warning-and-errors-in-a-custom-action%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Some time ago <a href="http://www.codewrecks.com/blog/index.php/2010/01/14/logging-in-custom-build-action-for-tfs-build-2010/">I blogged about</a> logging in custom action for TFS build 2010, I left out some details. Suppose you want to create a warning or an error and not a simple message, you need to create a specialized version of the LogWarning that logs a real warning.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image22.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb22.png" width="398" height="274" /></a> </p>
<p>You can do the same with errors.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image23.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb23.png" width="371" height="278" /></a> </p>
<p>These two methods permit you to log warnings and errors during a custom build action execution, let’s see how they affect the output. First of all you can verify that when you log an error the build partially succeeds</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image24.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb24.png" width="275" height="121" /></a> </p>
<p>The error and warning are reported in the detailed report with their right icons</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image25.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb25.png" width="304" height="188" /></a> </p>
<p>And they are also reported in the “View Summary” of the build</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image26.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb26.png" width="300" height="165" /></a> </p>
<p>Next time I’ll explain you how to wrap a msbuild Custom Task in a custom action.</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Tfs" rel="tag">Tfs</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=glXGT7ULiig:S2tC3k4KAQU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=glXGT7ULiig:S2tC3k4KAQU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=glXGT7ULiig:S2tC3k4KAQU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=glXGT7ULiig:S2tC3k4KAQU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=glXGT7ULiig:S2tC3k4KAQU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=glXGT7ULiig:S2tC3k4KAQU:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/glXGT7ULiig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/18/log-warning-and-errors-in-a-custom-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/18/log-warning-and-errors-in-a-custom-action/</feedburner:origLink></item>
		<item>
		<title>Set verbosity of logging during Tfs 2010 build</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/C5u69AI6Kbw/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/18/set-verbosity-of-logging-during-tfs-2010-build/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 10:17:00 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[TFS Build]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/18/set-verbosity-of-logging-during-tfs-2010-build/</guid>
		<description><![CDATA[
			
				
			
		
To test a little bit how you can log information during a TFS 2010 build you can create a simple activity , this activity simply has a Message property and log three messages, at different BuildMessageImportance level
 
The utility function is the following one
 
Really simple isn’t it?  . Now you need to insert [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F18%2Fset-verbosity-of-logging-during-tfs-2010-build%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F18%2Fset-verbosity-of-logging-during-tfs-2010-build%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>To test a little bit how you can log information during a TFS 2010 build you can create a simple activity , this activity simply has a Message property and log three messages, at different BuildMessageImportance level</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image16.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb16.png" width="861" height="357" /></a> </p>
<p>The utility function is the following one</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image17.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb17.png" width="462" height="305" /></a> </p>
<p>Really simple isn’t it? <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Now you need to insert this custom action inside a standard tfs build definition file, to make this happens I need to remind you that you need to include the xaml build definition file in a project included in a solution where your custom action is defined, if not you cannot use the designer and you need to manually edit xaml file.</p>
<p>To easy this process I branched directly the build definition file, with this simple trick, I edit the definition file in my test project, do a check-in and when I want to update the real build definition I do a simple merge. Then I insert my action in the build process. So I created a new build definition from the default template, configure it, then branched into my test project. </p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image18.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb18.png" width="710" height="390" /></a> </p>
<p>I highlighted the two important facts: 1) the file is included in the project DotNetMarche.Activities.Workflow.Test, 2) The project with the action is included in the solution, now I can drop the LogSample action into the build definition file using the graphical editor, check-in, merge and launch the build with the new definition (I remember you that you need to deploy also the custom activity <a href="http://www.codewrecks.com/blog/index.php/2009/12/07/custom-activities-in-tfs2010/">as described here</a>), here is the result.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image19.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb19.png" width="335" height="271" /></a> </p>
<p>As you can verify, only the message with BuildMessageImportance.High is showed, this because the entire build process has an argument that determines the level of log verbosity. Now try to change this value to Detailed. You should click the “Arguments” and locate the Verbosity argument.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image20.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb20.png" width="734" height="355" /></a> </p>
<p>Now change it to Detailed, check-in, merge <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  and launch the build again to verify the result.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image21.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb21.png" width="303" height="217" /></a> </p>
<p>Now you can see that in “Detailed” level of verbosity, the workflow logs even the Normal level. The morale is that in your custom activity you should use BuildMessageImportance with great care. Really important messages must be showed with High importance, detailed with Normal, and you should use Low for really verbose messages. But remember, always do a verbose log, because if something gets wrong in the build, you can always change the BuildVerbosity level and verify in detail what is really gone wrong in your custom action.</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/tfs" rel="tag">tfs</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=C5u69AI6Kbw:o5_33skAVsA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=C5u69AI6Kbw:o5_33skAVsA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=C5u69AI6Kbw:o5_33skAVsA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=C5u69AI6Kbw:o5_33skAVsA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=C5u69AI6Kbw:o5_33skAVsA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=C5u69AI6Kbw:o5_33skAVsA:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/C5u69AI6Kbw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/18/set-verbosity-of-logging-during-tfs-2010-build/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/18/set-verbosity-of-logging-during-tfs-2010-build/</feedburner:origLink></item>
		<item>
		<title>Merging and resolving conflicts</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/oN8_FvAfZ7g/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/16/merging-and-resolving-conflicts/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 09:38:02 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Branch]]></category>
		<category><![CDATA[Tfs]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/16/merging-and-resolving-conflicts/</guid>
		<description><![CDATA[
			
				
			
		
Sometimes I hear people that does not like the way TFS manages merge conflicts, and quite all of the time the problem is that they does not like the Visual Studio Integrated tool to merge two files. I must admit that I do not like that tool too, but this is not related to TFS, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F16%2Fmerging-and-resolving-conflicts%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F16%2Fmerging-and-resolving-conflicts%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes I hear people that does not like the way TFS manages merge conflicts, and quite all of the time the problem is that they does not like the Visual Studio Integrated tool to merge two files. I must admit that I do not like that tool too, but this is not related to TFS, because conflicts resolution is an operation that must be done by people locally. </p>
<p>For those people, like me, that work a lot with subversion, probably <a href="http://winmerge.org/">winmerge</a> is the right tool to resolve merge conflicts, and it is really simple to instruct Visual Studio to <a href="http://www.neovolve.com/post/2007/06/19/using-winmerge-with-tfs.aspx">use winmerge instead of the standard tool to merge two files</a>. If you want to spend some money, <a href="http://www.scootersoftware.com/">BeyondCompare</a> is really a great tool, suggested to me by my dear friend <a href="http://blogs.ugidotnet.org/janky/Default.aspx">Janky</a>. </p>
<p>Remember, conflicts resolution is an operation that has nothing to do with your Source Control System <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Tfs" rel="tag">Tfs</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oN8_FvAfZ7g:GsqS1N3pX4Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oN8_FvAfZ7g:GsqS1N3pX4Y:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oN8_FvAfZ7g:GsqS1N3pX4Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=oN8_FvAfZ7g:GsqS1N3pX4Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oN8_FvAfZ7g:GsqS1N3pX4Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=oN8_FvAfZ7g:GsqS1N3pX4Y:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/oN8_FvAfZ7g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/16/merging-and-resolving-conflicts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/16/merging-and-resolving-conflicts/</feedburner:origLink></item>
		<item>
		<title>Another one from the TFS Rangers</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/dbE8c59g6Nc/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/16/another-one-from-the-tfs-rangers/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 08:26:19 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Tfs]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/16/another-one-from-the-tfs-rangers/</guid>
		<description><![CDATA[
			
				
			
		
If you are interested in implementing TFS 2010 in your company, or if you already implemented TFS 2010 beta2 but you want to go deeper because you want to use your tfs in a optimal way, you can check the Visual Studio 2010 Team Foundation SERver REquirements Management guide from the TFS Rangers. You will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F16%2Fanother-one-from-the-tfs-rangers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F16%2Fanother-one-from-the-tfs-rangers%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you are interested in implementing TFS 2010 in your company, or if you already implemented TFS 2010 beta2 but you want to go deeper because you want to use your tfs in a optimal way, you can check the <a href="http://download.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=VSTFS2010RM&amp;DownloadId=101397&amp;FileTime=129080088135730000&amp;Build=16135">Visual Studio 2010 Team Foundation SERver REquirements Management</a> guide from the TFS Rangers. You will find tons of useful information <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Alk</p>
<p>Tags: <a href="http://technorati.com/tag/Tfs" rel="tag">Tfs</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=dbE8c59g6Nc:H33yGdJ2_7Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=dbE8c59g6Nc:H33yGdJ2_7Q:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=dbE8c59g6Nc:H33yGdJ2_7Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=dbE8c59g6Nc:H33yGdJ2_7Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=dbE8c59g6Nc:H33yGdJ2_7Q:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=dbE8c59g6Nc:H33yGdJ2_7Q:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/dbE8c59g6Nc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/16/another-one-from-the-tfs-rangers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/16/another-one-from-the-tfs-rangers/</feedburner:origLink></item>
		<item>
		<title>Managing different config file with TFS Branching</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/RoxkNTqWKTI/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/15/managing-different-config-file-with-tfs-branching/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 13:53:00 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Tfs]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/15/managing-different-config-file-with-tfs-branching/</guid>
		<description><![CDATA[
			
				
			
		
I begin working on a open source project, hosted on codeplex. The first thing I need to do is to modify configuration files to make it work on my machine (in my situation I need only to change the sql connection string). In this scenario a big problem arise, if every developer has a different [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F15%2Fmanaging-different-config-file-with-tfs-branching%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F15%2Fmanaging-different-config-file-with-tfs-branching%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I begin working on a open source project, hosted on codeplex. The first thing I need to do is to modify configuration files to make it work on my machine (in my situation I need only to change the sql connection string). In this scenario a big problem arise, if every developer has a different configuration file, there is the possibility that someone will do a wrong checkin, and send to the server his configuration file. This is a “configuration hell” when at each check-in you grab modification to configuration file of other developers.</p>
<p>A possible solution in this scenario is to use branches. Suppose you have your standard web.config file that needs to be modified, the first thing I do is to branch it to a different location.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image11.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb11.png" width="522" height="180" /></a> </p>
<p>Now I need to modify my workspace, making my web.config local file to point to my branched version. Go to File\Source Control\Workspaces, and edit your workspace in this way.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image12.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb12.png" width="957" height="120" /></a> </p>
<p>The important line is the one highlighted in yellow. Basically I told to visual studio to map the d:\develop\Dexter\dexterblogengine\trunk\dexter.web.site\web.config to the $/dexterblogengine/branc/… With this configuration if you edit web.config to modify the connection string you can verify that in the server the default file is not checked out by you.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image13.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb13.png" width="328" height="312" /></a> </p>
<p>You can also see that web.config is grayed out, this because this file is actually not mapped locally by you, so you cannot edit or modify. Then verify that the modified file is the one you branched before.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image14.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb14.png" width="562" height="176" /></a> </p>
<p>Ok, now every modification I do to my web.config file does not disturb other people because it point to a version in tfs that was branched from the original one. When I need to modify the master web.config file, to add some extra configuration I can simply edit my local file and then merge all news to the master file.</p>
<p>The good info about this configuration is that periodically you can do a merge from the master file to your local file to grab master modification to the file.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image15.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb15.png" width="616" height="442" /></a>&#160; </p>
<p>With this simple configuration many people can work, each one with his configuration file, without disturbing each other.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/TFS" rel="tag">TFS</a> <a href="http://technorati.com/tag/Branch" rel="tag">Branch</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=RoxkNTqWKTI:bd9VDeOa4pk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=RoxkNTqWKTI:bd9VDeOa4pk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=RoxkNTqWKTI:bd9VDeOa4pk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=RoxkNTqWKTI:bd9VDeOa4pk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=RoxkNTqWKTI:bd9VDeOa4pk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=RoxkNTqWKTI:bd9VDeOa4pk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/RoxkNTqWKTI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/15/managing-different-config-file-with-tfs-branching/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/15/managing-different-config-file-with-tfs-branching/</feedburner:origLink></item>
		<item>
		<title>Logging in Custom Build action for Tfs Build 2010</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/FClMclDS6po/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/14/logging-in-custom-build-action-for-tfs-build-2010/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 17:16:00 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[TfsBuild]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/14/logging-in-custom-build-action-for-tfs-build-2010/</guid>
		<description><![CDATA[
			
				
			
		
In a previous post I dealt with the creation of a Custom Activity to use in TFS2010 builds, in that example I did not dealt about logging. Logging is a vital task to do in custom action, because it is quite difficult to attach a debugger to the Build Agent, and if a build fails, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F14%2Flogging-in-custom-build-action-for-tfs-build-2010%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F14%2Flogging-in-custom-build-action-for-tfs-build-2010%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In a <a href="http://www.codewrecks.com/blog/index.php/2009/12/07/custom-activities-in-tfs2010/">previous post</a> I dealt with the creation of a Custom Activity to use in TFS2010 builds, in that example I did not dealt about logging. Logging is a vital task to do in custom action, because it is quite difficult to attach a debugger to the Build Agent, and if a build fails, it is really important to be able to understand what is gone wrong.</p>
<p>If you want to log from a custom action you can use this simple function</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:cde100b5-a7a7-4b6c-a3f0-b58dc6078e4d" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #000000;"> </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> LogMessage(String message, CodeActivityContext context)
        {
           BuildInformationRecord</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">BuildMessage</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> record </span><span style="color: #000000;">=</span><span style="color: #000000;">
             </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> BuildInformationRecord</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">BuildMessage</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">()
             {
                 Value </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> BuildMessage()
                    {
                        Importance </span><span style="color: #000000;">=</span><span style="color: #000000;"> BuildMessageImportance.High,
                        Message </span><span style="color: #000000;">=</span><span style="color: #000000;"> message,
                    },
             };

            context.Track(record);
        }</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Thanks to this function I can use with my custom activity, here is how I use it in my XmlPoke activity, used to change content of an xml file.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:d31e06a5-4278-40fc-b415-26cd6707691c" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #000000;">LogMessage(</span><span style="color: #800000;">"</span><span style="color: #800000;">XPoke on the file </span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> filePath, context);</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Thanks to this message I can find information on the build log.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image10.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb10.png" width="545" height="151" /></a> </p>
<p>This is really useful because I can, in this example, verify witch file was changed by my action simply looking at the build log.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/TfsBuild ContinuosIntegration" rel="tag">TfsBuild ContinuosIntegration</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=FClMclDS6po:m0DtYfy9pdo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=FClMclDS6po:m0DtYfy9pdo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=FClMclDS6po:m0DtYfy9pdo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=FClMclDS6po:m0DtYfy9pdo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=FClMclDS6po:m0DtYfy9pdo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=FClMclDS6po:m0DtYfy9pdo:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/FClMclDS6po" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/14/logging-in-custom-build-action-for-tfs-build-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/14/logging-in-custom-build-action-for-tfs-build-2010/</feedburner:origLink></item>
		<item>
		<title>Force databinding update in Winform without waiting for lose focus</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/ErwZi5rjTxc/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/14/force-databinding-update-in-winform-without-waiting-for-lose-focus/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 09:38:43 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[.NET framework]]></category>
		<category><![CDATA[Winforms]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/14/force-databinding-update-in-winform-without-waiting-for-lose-focus/</guid>
		<description><![CDATA[
			
				
			
		
I have a winform application where the user can select an element into a grid, edit its properties, and then decide if the modification should be saved or rejected. Thanks to binding, IEditableObject and INotifyPropertyChanged, writing such feature is a breeze, but the user signaled me that something was wrong. He told me: “suppose you [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F14%2Fforce-databinding-update-in-winform-without-waiting-for-lose-focus%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F14%2Fforce-databinding-update-in-winform-without-waiting-for-lose-focus%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have a winform application where the user can select an element into a grid, edit its properties, and then decide if the modification should be saved or rejected. Thanks to binding, IEditableObject and INotifyPropertyChanged, writing such feature is a breeze, but the user signaled me that something was wrong. He told me: “suppose you choose an element, then change a value in the combo, nothing happens. When I press tab or move the “Save” and “Cancel” button become visible, but I wanto them to be visible as soon as I press a char into textbox or change a value in the combo.</p>
<p>The user does not like this approach, he explicitly asked me to show “Save” and “Cancel” button when someone change a value and keep them hidden otherwise, but he does not like the need to focus change to make them visible. The solution was really simple, you need to intercept some events to force binding update whenever you want.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:42d64eed-fdd8-4d3a-8db7-1da7507507a9" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> txtAction_TextChanged(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)
{
    txtAction.DataBindings[</span><span style="color: #800000;">"</span><span style="color: #800000;">Text</span><span style="color: #800000;">"</span><span style="color: #000000;">].WriteValue();
}

</span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> cmbActionStatus_SelectedValueChanged(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)
{
    cmbActionStatus.DataBindings[</span><span style="color: #800000;">"</span><span style="color: #800000;">SelectedValue</span><span style="color: #800000;">"</span><span style="color: #000000;">].WriteValue();
}</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>With this code I’m simply intercepting the change in the texbox and the change in selected value of the combo, then I can simply use the DataBindings array that each control has, to find the Binding object related to the bound property (Text for textbox, and SelectedValue for combo), and simply call WriteValue() method.</p>
<p>With this code, all my binding logic is aware of change as soon as the user type some char into the textbox or change the value of a combo.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Winforms" rel="tag">Winforms</a> <a href="http://technorati.com/tag/.NET Framework" rel="tag">.NET Framework</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ErwZi5rjTxc:FXHwdRKv3cY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ErwZi5rjTxc:FXHwdRKv3cY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ErwZi5rjTxc:FXHwdRKv3cY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=ErwZi5rjTxc:FXHwdRKv3cY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ErwZi5rjTxc:FXHwdRKv3cY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ErwZi5rjTxc:FXHwdRKv3cY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/ErwZi5rjTxc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/14/force-databinding-update-in-winform-without-waiting-for-lose-focus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/14/force-databinding-update-in-winform-without-waiting-for-lose-focus/</feedburner:origLink></item>
		<item>
		<title>Moving a TeamProjectCollection from one server to another</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/4w81NbBIJrA/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/13/moving-a-teamprojectcollection-from-one-server-to-another/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 13:57:48 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/13/moving-a-teamprojectcollection-from-one-server-to-another/</guid>
		<description><![CDATA[
			
				
			
		
One of the new feature of TFS 2010 is the concept of Project Collection, that is a sort of container for Team Projects. You can think that a Project Collection can be used to have a sort of multiple TFS inside one single server. If you have multiple customers, and you want them to access [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F13%2Fmoving-a-teamprojectcollection-from-one-server-to-another%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F13%2Fmoving-a-teamprojectcollection-from-one-server-to-another%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the new feature of TFS 2010 is the concept of Project Collection, that is a sort of container for Team Projects. You can think that a Project Collection can be used to have a sort of multiple TFS inside one single server. If you have multiple customers, and you want them to access your TFS, but you want to be sure that customer A cannot see team projects of customer B, you can create a separate project collection for each customer.</p>
<p>One cool feature is that you can move/copy project collections between servers, I have downloaded the trial of VS2010 as <a href="http://blogs.msdn.com/briankel/archive/2007/09/06/a-more-reliable-and-faster-download-experience-for-rosario-vs08-vpc-s.aspx">explained in Brian Keller’s blog</a>, then I worked on the hyper-v version of the machine for a couple of session in Italy, then I need to move everything I did into another blank VM that uses Virtual Pc, to be run when Hyper-v is not available. To move my modified collection I disconnected the project collection from the original tfs instance.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image7.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb7.png" width="543" height="284" /></a> </p>
<p>Once the Project collection was disconnected I simply did a database backup, then moved the backup on the other machine. In the destination machine I detach the original project collection, then restore the database backup from the source machine and reattach the collection again. When you clicked on the “Attach Team Project collection” button a dialog will appear</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image8.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb8.png" width="706" height="267" /></a> </p>
<p>In my situation I can verify that a single project collection is importable, the one I detached in the previous step, but now I restored the database from the source machine and that collection contains my new project. After I finished attaching the collection I can verify that it now contains my new Team Project. I got some warning from the process, because the import process find that reporting services and sharepoint already exists (I imported in a machine where that collection already existed) so it tells me to verify if reporting and sharepoint works as expected.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image9.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb9.png" width="652" height="494" /></a> </p>
<p>As you can see the DefaultCollection contains my new project I created on another machine and the ProjectCollection was moved between tfs instances.</p>
<p>alk.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=4w81NbBIJrA:ImwbfvFvtnk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=4w81NbBIJrA:ImwbfvFvtnk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=4w81NbBIJrA:ImwbfvFvtnk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=4w81NbBIJrA:ImwbfvFvtnk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=4w81NbBIJrA:ImwbfvFvtnk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=4w81NbBIJrA:ImwbfvFvtnk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/4w81NbBIJrA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/13/moving-a-teamprojectcollection-from-one-server-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/13/moving-a-teamprojectcollection-from-one-server-to-another/</feedburner:origLink></item>
		<item>
		<title>Again on IoC, windsor and Release</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/16mLAV5gG9I/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/12/again-on-ioc-windsor-and-release/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 13:44:41 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/12/again-on-ioc-windsor-and-release/</guid>
		<description><![CDATA[
			
				
			
		
I have a windows service that is used as a scheduler to launch actions in a pluggable way. It possesses a basic bunch of logic, and the user can simply derive from an ActionBase, doing whatever he want in the Execute method and let basic scheduler classes to manage the rest. In the last month [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F12%2Fagain-on-ioc-windsor-and-release%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F12%2Fagain-on-ioc-windsor-and-release%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have a windows service that is used as a scheduler to launch actions in a pluggable way. It possesses a basic bunch of logic, and the user can simply derive from an ActionBase, doing whatever he want in the Execute method and let basic scheduler classes to manage the rest. In the last month I begin to experience some memory leak on an installation of the scheduler, this leak manifests itself with a constant increase of used RAM, until the process (64 bit) reaches approx 4.5 gb of memory (The server has 4 GB) and the whole server become really slow.</p>
<p>I begin to investigate on the various actions that gets executed, because since they download data, and perform a lot of operations I suspect that one of them is the cause of the leak, but after some investigation I realize that no one of the action is the real cause of this leak.</p>
<p>I go into production server and I decided to debug the process live, to see what is happening and trying to better identify the root cause, but since it is “production stuff” I cannot use profiler or some other tools, so I and <a href="http://www.primordialcode.com/">Guardian</a> decided to use <a href="http://blogs.msdn.com/joaol/archive/2008/09/03/how-to-use-windbg-to-debug-a-dump-of-a-32bit-net-app-running-on-a-x64-machine.aspx">WinDbg with Sos</a>. </p>
<p>For those like us, quite used to unmanaged development with C++, using windbg is not a pain (but I must admit that I never used for months <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). I’m convinced that WinDbg with SOS, is a hardcore tool, but once you gets used with it, it is the key one to find leak in managed code, especially when you are on production machines. For those not used to windbg+sos here is the path we follow to find the leak.</p>
<p>First of all we did a <strong>!dumpheap –stat</strong>, that showed us that we have a 500 mb of RAM used by String objects and another 250 MB used by Object[]. Since the process was using 1.3 gb of RAM, surely string and object arrays are half of the problem. Then we did a <strong>!dumpheap –type <em>System.String </em></strong>to dump details of instances that are live in the system. There were millions of them, but we verified that there are also a lot of Dictionary&lt;String, Object&gt; instances. So we take the address of one of this dictionary and did a <strong>!GCRoot address </strong>to find why it is was not collected by the GC. After a little bit, we found that all these dictionaries are referenced by Nhibernate Sessiona, that in turn are referenced by an our class named UnitOfWork that in turn was kept alive from the castle lifecycle manager.</p>
<p>The result is that I did a little modification last month, and the UnitOfWork was resolved with castle (to satisfy a dependency), but I forgot to call release on the container. I <a href="http://www.codewrecks.com/blog/index.php/2007/08/08/the-importance-of-windsorcontainerrelease/">blogged long time ago on this problem</a>, but it seems that it is able to bite me again. With a simple missed call to a Release method, I ended with every session to be kept in memory forever <img src='http://www.codewrecks.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and this is the cause of the problem.</p>
<p>alk.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=16mLAV5gG9I:SUwtI9lJARg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=16mLAV5gG9I:SUwtI9lJARg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=16mLAV5gG9I:SUwtI9lJARg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=16mLAV5gG9I:SUwtI9lJARg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=16mLAV5gG9I:SUwtI9lJARg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=16mLAV5gG9I:SUwtI9lJARg:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/16mLAV5gG9I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/12/again-on-ioc-windsor-and-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/12/again-on-ioc-windsor-and-release/</feedburner:origLink></item>
		<item>
		<title>Deploy a database project with tfs build 2010</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/ZJF-fFTZip0/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 15:29:37 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[DataDude]]></category>
		<category><![CDATA[TFS Build]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/</guid>
		<description><![CDATA[
			
				
			
		
If you want to deploy a database project into a target sql server instance during a tfs 2010 build, you can use with success the basic MsBuildTask, similar to tfs2008.
I decided to deploy the database, only if the tests are ok and the build is ok, so I place a condition activity under the test [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F04%2Fdeploy-a-database-project-with-tfs-build-2010%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F04%2Fdeploy-a-database-project-with-tfs-build-2010%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you want to deploy a database project into a target sql server instance during a tfs 2010 build, you can use with success the basic MsBuildTask, <a href="http://www.codewrecks.com/blog/index.php/2009/10/23/automatic-deployment-of-a-web-application-with-tfs-build/">similar to tfs2008</a>.</p>
<p>I decided to deploy the database, only if the tests are ok and the build is ok, so I place a condition activity under the test phase and I set the condition to pass only if the test and build status are different from Failed</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb.png" width="604" height="228" /></a> </p>
<p>Now I need to know where the dbproj will be located in the disk during the build, and since I know the repository path, I can use a specific TFS build action to convert the source control path into physical path. The source control path is “$/Experiments/NorthwindTest/NorthwindTest.Database/NorthwindTest.Database.dbproj” so I can drop a “<strong>ConvertWorkspaceItem</strong>” activity to convert this path to the physical one. First of all I need to declare a variable where to put the result.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb1.png" width="687" height="506" /></a> </p>
<p>I called this variable “dbProject” (String type). Now I can configure my <strong>ConvertWorkspaceItem</strong> activity I dropped in the “then” part of my condition activity.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb2.png" width="485" height="136" /></a> </p>
<p>This activity needs three variables, the first is the source control path you want to translate, the second is the name of the variable that will contain the result and the third is the Workspace to use (is stored into the global variable <strong>Workspace</strong>).</p>
<p>Following this activity I dropped a WriteBuildMessage activity, used to write something into the build log (I wrote the exact path of the database project that is to be deployed)</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb3.png" width="915" height="207" /></a> </p>
<p>This is only informational, but it is useful to check during the build process.</p>
<p>The most important activity is the <strong>MsBuildActivity</strong> that will do the real work. This activity invokes Msbuild.exe that in turns will target the database project to deploy. The most important property is the <strong>CommandLineArgument </strong>where you must specify all details of the deploy</p>
<p><em>&quot;/p:TargetDatabase=NorthwindTest&quot; +     <br />&quot; /p:&quot;&quot;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA&quot;&quot;&quot; +      <br />&quot; /p:&quot;&quot;TargetConnectionString=Data Source=10.0.0.99\SQL2008,49400%3Buser=sa%3Bpwd=Pa$$w0rd&quot;&quot;&quot; +      <br />&quot; /p:DeployToDatabase=true&quot;</em></p>
<p>These properties are used to specify the name of the database, the datapath, the connectionstring where to deploy the database, and they override the standard one defined on the project. As you can see in connection string I used the sa password, that is strongly discouraged for security reasons in production environment. You can use integrated security if the user used to run the team agent has the right to create a database in the target instance.</p>
<p>Finally these are all the properties of the msbuild activity.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb4.png" width="468" height="431" /></a> </p>
<p>LogFile is really important, because you want a msbuild log file of what is happened during the deploy. You can check this file in the logs\ subfolder of the drop location </p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb5.png" width="466" height="156" /></a> </p>
<p>If you open deploydatabase.log, you can find all the information you need on what is happened, here is a little extract.</p>
<p><em>Build started 1/4/2010 7:08:38 AM.     <br />Project &quot;C:\Builds\1\Experiments\DeployDatabase\Sources\NorthwindTest\NorthwindTest.Database\NorthwindTest.Database.dbproj&quot; on node 1 (Deploy target(s)).      <br />DspDeploy:      <br />&#160; Deployment script generated to:      <br />&#160; C:\Builds\1\Experiments\DeployDatabase\Binaries\NorthwindTest.Database.sql      <br />&#160; Creating NorthwindTest&#8230;      <br />&#160; Creating [dbo].[Categories]&#8230;      <br />&#160; Creating PK_Categories&#8230;      <br />&#160; Creating [dbo].[Categories].[CategoryName]&#8230;      <br />&#160; Creating [dbo].[CustomerCustomerDemo]&#8230;      <br />&#160; Creating PK_CustomerCustomerDemo&#8230;      <br />&#160; Creating [dbo].[CustomerDemographics]&#8230;      <br />&#160; Creating PK_CustomerDemographics&#8230;      <br />&#160; Creating [dbo].[Customers]&#8230;      <br />&#160; Creating PK_Customers&#8230;</em></p>
<p>A really important property is the Target, that is set to <strong>New String() {“Deploy”}</strong>. A database project supports some different targets, as an example the build, deploy, dataGeneration and StaticCodeAnalysis, each of them will perform a different task. </p>
<p>The project to deploy is specified in the <strong>Project</strong> property, and as you can see I use the variable dbProject that was populated with the ConvertWorkspaceItem.</p>
<p>If you check build details you can find all the information you need about the build process</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image6.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2010/01/image_thumb6.png" width="785" height="308" /></a> </p>
<p>From here you can verify project directory, and all the options that are passed to the msbuild.exe. You can now schedule the build and verify that the database is deployed on target server.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/TfsBuild" rel="tag">TfsBuild</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZJF-fFTZip0:hOGEG1pZhgE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZJF-fFTZip0:hOGEG1pZhgE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZJF-fFTZip0:hOGEG1pZhgE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=ZJF-fFTZip0:hOGEG1pZhgE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZJF-fFTZip0:hOGEG1pZhgE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZJF-fFTZip0:hOGEG1pZhgE:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/ZJF-fFTZip0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/</feedburner:origLink></item>
		<item>
		<title>SATA and E-Sata</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/Qddwvgxlp-8/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2010/01/02/sata-and-e-sata/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 11:08:59 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2010/01/02/sata-and-e-sata/</guid>
		<description><![CDATA[
			
				
			
		
I’ve bought recently an external 3.5 HD usb2.0/E-sata enclosure. I mounted a 1 Terabyte HD into it, and connected to my desktop pc with E-Sata. It does not work.
Then I take the cable that was furnished with enclosure, that permits me to bring standard SATA port of the motherboard with an external E-Sata connector. With [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F02%2Fsata-and-e-sata%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2010%2F01%2F02%2Fsata-and-e-sata%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I’ve bought recently an external 3.5 HD usb2.0/E-sata enclosure. I mounted a 1 Terabyte HD into it, and connected to my desktop pc with E-Sata. It does not work.</p>
<p>Then I take the cable that was furnished with enclosure, that permits me to bring standard SATA port of the motherboard with an external E-Sata connector. With this one the HD works well. </p>
<p>Then I bought an express card e-sata card for my laptop, and the HD wont work with it. It gives me the final proof that E-Sata is not simply a different port from SATA, but it is a slightly different types of controller. My external box in fact works only when connected to SATA with a cable that transform sata connector to E-Sata one, but it does not work when connected to a real e-sata connector.</p>
<p>Now I’m looking for an external 3.5 HD box that works well with a real E-Sata.</p>
<p>alk.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Qddwvgxlp-8:Crd70BQlrIk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Qddwvgxlp-8:Crd70BQlrIk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Qddwvgxlp-8:Crd70BQlrIk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=Qddwvgxlp-8:Crd70BQlrIk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Qddwvgxlp-8:Crd70BQlrIk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Qddwvgxlp-8:Crd70BQlrIk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/Qddwvgxlp-8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2010/01/02/sata-and-e-sata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2010/01/02/sata-and-e-sata/</feedburner:origLink></item>
		<item>
		<title>Create a SqlRule for database project in vs2010 beta2</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/X76KMxG5muU/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/30/create-a-sqlrule-for-database-project-in-vs2010-beta2/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 14:05:59 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Visual Studio Team System]]></category>
		<category><![CDATA[DataDude]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/30/create-a-sqlrule-for-database-project-in-vs2010-beta2/</guid>
		<description><![CDATA[
			
				
			
		
Custom Rule for database projects is one of my favorite extension point of Visual Studio 2008, and I blogged about it some time ago. Yesterday I tried to convert my sample rule for visual studio 2010 beta2, and there are a lot of things that are changed. The result will be a simple rule that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F30%2Fcreate-a-sqlrule-for-database-project-in-vs2010-beta2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F30%2Fcreate-a-sqlrule-for-database-project-in-vs2010-beta2%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Custom Rule for database projects is one of my favorite extension point of Visual Studio 2008, and I blogged about <a href="http://www.codewrecks.com/blog/index.php/2009/11/28/database-edition-custom-rule/">it some time ago</a>. Yesterday I tried to convert my sample rule for visual studio 2010 beta2, and there are a lot of things that are changed. The result will be a simple rule that force column name to be in form xxxx_xxxxxxxx as in the past example</p>
<p>First of all the extension needs to specify its details with attributes. The DatabaseSchemaProviderCompatibility permits you to specify the version of the database the rule applies to, in my example a standard sqlDatabase, then the DataRuleAttirbute is used to specify name, id, description, and other attributes of the rule. Finally you need to specify a series of SupportedElementTypeAttribute to declare the kind of database objects you want to validate, for this example you simply need to specify ISqlColumn because I want only to validate column names.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image25.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb25.png" width="599" height="207" /></a> </p>
<p>The important aspect is that all the strings passed to DataRuleAttribute needs to be included in a resource file, and the very first things to do is creating a suitable resource file.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image26.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb26.png" width="233" height="216" /></a> </p>
<p>Then you need to populate it with name and description that you want to use in your rule.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image27.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb27.png" width="622" height="182" /></a> </p>
<p>Now you can create a file that stores all these constants, for an easier use. As you can see the ResourceBaseName string is the name of the resource file.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image28.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb28.png" width="644" height="151" /></a> </p>
<p>And the game is done. Now you only need to write the code that validate column names. </p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:0777c0db-6e90-4b01-8f9d-f539553c012b" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #000000;"> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> IList</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">DataRuleProblem</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> Analyze(DataRuleSetting ruleSetting, DataRuleExecutionContext context)
        {
            List</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">DataRuleProblem</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> problems </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> List</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">DataRuleProblem</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">();

            IList</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> nameParts </span><span style="color: #000000;">=</span><span style="color: #000000;"> context.ModelElement.Name.Parts;
            IDatabaseColumn column </span><span style="color: #000000;">=</span><span style="color: #000000;"> context.ModelElement </span><span style="color: #0000FF;">as</span><span style="color: #000000;"> IDatabaseColumn;
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (column </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;

            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (nameParts.Count </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800080;">3</span><span style="color: #000000;">)
            {
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">Regex.Match(nameParts[</span><span style="color: #800080;">2</span><span style="color: #000000;">], </span><span style="color: #800000;">@"</span><span style="color: #800000;">^\w{4}_\w*</span><span style="color: #800000;">"</span><span style="color: #000000;">).Success)
                {
                    </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> message </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;">.Format(
                        </span><span style="color: #800000;">"</span><span style="color: #800000;">Column {0} of table {1}.{2} must have the form pref_columnname.</span><span style="color: #800000;">"</span><span style="color: #000000;">,
                         nameParts[</span><span style="color: #800080;">2</span><span style="color: #000000;">], nameParts[</span><span style="color: #800080;">0</span><span style="color: #000000;">], nameParts[</span><span style="color: #800080;">1</span><span style="color: #000000;">]);
                    DataRuleProblem p </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> DataRuleProblem(</span><span style="color: #0000FF;">this</span><span style="color: #000000;">, message, context.ModelElement);

                    p.Severity </span><span style="color: #000000;">=</span><span style="color: #000000;"> DataRuleProblemSeverity.Error;
                    problems.Add(p);
                }
            }

            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> problems;
        }</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>This rule is really simple, but it works. One of the most difficult aspect in writing such an extension, is having a knowledge of the structure used by the database edition to represent objects. An important thing is that you can write everywhere in the rule the line</p>
<p>System.Diagnostic.Debugger.Break</p>
<p>And when you build the test database project, you can debug visual studio, and you can inspect with the debugger whatever object you need.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image29.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb29.png" width="937" height="285" /></a> </p>
<p>With the power of the debugger you can better understand data that is passed to the rule by the designer. To register the rule you need to copy into a specific Visual Studio folder, and register it in the gac. You can accomplish all with a series of post build actions.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:22a4b358-6ac5-4425-b2fa-f355a5aaef39" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #0000FF;">copy</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">$(TargetDir)$(TargetName)$(TargetExt)</span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName)$(TargetExt)</span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">/</span><span style="color: #000000;">y

</span><span style="color: #0000FF;">copy</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">$(ProjectDir)$(TargetName).Extensions.xml</span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName).Extensions.xml</span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">/</span><span style="color: #000000;">y 

</span><span style="color: #000000;">"</span><span style="color: #000000;">C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe</span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">/</span><span style="color: #0000FF;">if</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName)$(TargetExt)</span><span style="color: #000000;">"</span><span style="color: #000000;"> 

</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>With these simple three lines we are copying the dll with the custom rule, register in the gat and copy the xml file with the description of the plugin, that is completely equal to the one used with the old example.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:cec18f83-d7d0-4761-a113-bfcb37b9cf74" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #0000FF;">&lt;?</span><span style="color: #FF00FF;">xml version="1.0" encoding="utf-8" </span><span style="color: #0000FF;">?&gt;</span><span style="color: #000000;">
</span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">extensions
  </span><span style="color: #FF0000;">assembly</span><span style="color: #0000FF;">=""</span><span style="color: #FF0000;">
  version</span><span style="color: #0000FF;">="1"</span><span style="color: #FF0000;">
  xmlns</span><span style="color: #0000FF;">="urn:Microsoft.Data.Schema.Extensions"</span><span style="color: #FF0000;">
  xmlns:xsi</span><span style="color: #0000FF;">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #FF0000;">
  xsi:schemaLocation</span><span style="color: #0000FF;">="urn:Microsoft.Data.Schema.Extensions Microsoft.Data.Schema.Extensions.xsd"</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">

    </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">extension </span><span style="color: #FF0000;">type</span><span style="color: #0000FF;">="SqlRule.MyStylePrefixedTable"</span><span style="color: #FF0000;">
                assembly </span><span style="color: #0000FF;">="SqlRule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc8904c79a049792"</span><span style="color: #FF0000;">
                enabled</span><span style="color: #0000FF;">="true"</span><span style="color: #0000FF;">/&gt;</span><span style="color: #000000;">
</span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">extensions</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Visual Studio 2010" rel="tag">Visual Studio 2010</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=X76KMxG5muU:ajBzmrSUFFY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=X76KMxG5muU:ajBzmrSUFFY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=X76KMxG5muU:ajBzmrSUFFY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=X76KMxG5muU:ajBzmrSUFFY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=X76KMxG5muU:ajBzmrSUFFY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=X76KMxG5muU:ajBzmrSUFFY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/X76KMxG5muU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/30/create-a-sqlrule-for-database-project-in-vs2010-beta2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/30/create-a-sqlrule-for-database-project-in-vs2010-beta2/</feedburner:origLink></item>
		<item>
		<title>Workflow and test capability not enabled in lab management</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/mRKhO9Kl0xw/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/24/workflow-and-test-capability-not-enabled-in-lab-management/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 09:52:56 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Lab Management]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/24/workflow-and-test-capability-not-enabled-in-lab-management/</guid>
		<description><![CDATA[
			
				
			
		
I deployed my first machine with lab management, but when the deploy finished I verify that workflow capability and test capability are not enabled in the machine. This is how you should see deployed machine
 
If the hilighted icons have a red cross instead of the play button you have a problem. Quite always the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F24%2Fworkflow-and-test-capability-not-enabled-in-lab-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F24%2Fworkflow-and-test-capability-not-enabled-in-lab-management%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I deployed my first machine with lab management, but when the deploy finished I verify that workflow capability and test capability are not enabled in the machine. This is how you should see deployed machine</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image20.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb20.png" width="455" height="158" /></a> </p>
<p>If the hilighted icons have a red cross instead of the play button you have a problem. Quite always the problem rely on permissions, so the best way to solve it is to connect to the machine and take a look at event viewer.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image21.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb21.png" width="533" height="416" /></a> </p>
<p>Unable to connect to the controller on xxxx permisssion denied… this operation can only be performed by members of TeamTestAgentService.</p>
<p>This problem is related to test controller, to solve it you first need to verify the user that is configured to run the “Visual Studio Test Agent” service, usually is network service. Then you need to log on the machine where the test contoller was installed, and manage local groups, you need to verify that in TeamTestAgentService group the name of the computer deployed is in the TeamTestAgentService group.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image22.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb22.png" width="434" height="457" /></a> </p>
<p>For the build agent the situation is similar, but you need to connect to the machine where the TFS is installed, goes to the project collection, then choose “Administer Group Membership” and click properties for the “Project Collection Build Service Accounts”. Now verify that the virtual machine deployed is added to this group.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image23.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb23.png" width="442" height="312" /></a> </p>
<p>When you verified those two security settings, simply restart both the service in the virtual machine, then click on the icon and choose “Repair Testing Capability” and the same for the workflow.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image24.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb24.png" width="386" height="249" /></a> </p>
<p>Now everything should work as expected</p>
<p>Alk.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:fcabb30c-faed-46b5-9b36-22be33e66cf4" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Lab+Management" rel="tag">Lab Management</a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mRKhO9Kl0xw:uZ3iqydkpBk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mRKhO9Kl0xw:uZ3iqydkpBk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mRKhO9Kl0xw:uZ3iqydkpBk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=mRKhO9Kl0xw:uZ3iqydkpBk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mRKhO9Kl0xw:uZ3iqydkpBk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mRKhO9Kl0xw:uZ3iqydkpBk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/mRKhO9Kl0xw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/24/workflow-and-test-capability-not-enabled-in-lab-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/24/workflow-and-test-capability-not-enabled-in-lab-management/</feedburner:origLink></item>
		<item>
		<title>Again on backup, RAID 1 is not backup</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/bS2gJAlw9g0/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/23/again-on-backup-raid-1-is-not-backup/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 21:18:27 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Backup]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/23/again-on-backup-raid-1-is-not-backup/</guid>
		<description><![CDATA[
			
				
			
		
Recently I’ve posted about backup, and I want to make another little tough, RAID 1 is not meant to replace backup. During the past I’ve heard people saying, “Hey I’ve this RAID 1 array, so I do not need backup, because if a disk will fail I have data in the other one.
This is WRONG!!!
If [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F23%2Fagain-on-backup-raid-1-is-not-backup%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F23%2Fagain-on-backup-raid-1-is-not-backup%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently I’ve posted about <a href="http://www.codewrecks.com/blog/index.php/2009/12/17/have-you-backup-your-data-today/">backup</a>, and I want to make another little tough, <a href="http://en.wikipedia.org/wiki/RAID">RAID 1</a> is not meant to replace backup. During the past I’ve heard people saying, “Hey I’ve this RAID 1 array, so I do not need backup, because if a disk will fail I have data in the other one.</p>
<p>This is WRONG!!!</p>
<p>If you are still convinced that RAID 1 or 5 can replace a backup consider these situations.</p>
<p>Virus: you get a virus that deletes or corrupt your data, data is lost because mirroring does not prevent this.</p>
<p>User Fault: A user deletes data from the disk array, data is lost.</p>
<p>Hardware failure: The raid controller experience a failure, so it begin to write rubbish into the disk array until all data is lost (it happened to one of our server)</p>
<p>Hardware failure 2: RAM of the machine is corrupted, the system begin to write rubbish on disk, data will be lost.</p>
<p>All these examples are meant to convince you that RAID system are not meant to substitute backup, but they are meant for high avaliability in case of hardware failure of one of the disk. The raid 1 is useful when one of the disk stop to work, you can still work with the good disk while rebuilding the array with a new disk.</p>
<p>Alk.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1e4cd257-7df9-4fd6-aa0e-6f5e345dce97" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Backup" rel="tag">Backup</a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=bS2gJAlw9g0:2bJ5YifYWqY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=bS2gJAlw9g0:2bJ5YifYWqY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=bS2gJAlw9g0:2bJ5YifYWqY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=bS2gJAlw9g0:2bJ5YifYWqY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=bS2gJAlw9g0:2bJ5YifYWqY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=bS2gJAlw9g0:2bJ5YifYWqY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/bS2gJAlw9g0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/23/again-on-backup-raid-1-is-not-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/23/again-on-backup-raid-1-is-not-backup/</feedburner:origLink></item>
		<item>
		<title>Configuring Lab Management, problem with network location</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/lmSLzVcawAk/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/23/configuring-lab-management-problem-with-network-location/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 16:08:36 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Lab Management]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/23/configuring-lab-management-problem-with-network-location/</guid>
		<description><![CDATA[
			
				
			
		
You can check the original post here, but I want to explain again how you can solve problem with network location during setup of Lab Management (because it happened to me both time I configured labmanagement, in desktop machine and in laptop machine), the problem manifests itself with this symptom 
 
You configure your machine [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F23%2Fconfiguring-lab-management-problem-with-network-location%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F23%2Fconfiguring-lab-management-problem-with-network-location%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>You can check the original post <a href="http://blogs.msdn.com/lab_management/archive/2009/06/08/networking-basics-for-lab-management-part-i.aspx">here</a>, but I want to explain again how you can solve problem with network location during setup of Lab Management (because it happened to me both time I configured labmanagement, in desktop machine and in laptop machine), the problem manifests itself with this symptom </p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/Capture.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Capture" border="0" alt="Capture" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/Capture_thumb.png" width="584" height="305" /></a> </p>
<p>You configure your machine with SCVMM, you test it and everything went ok, but the combo with network location is empty. I manually setup nablasoft.com as network location, but I’ll end with configuration warnings telling me </p>
<blockquote><p><em>The network location for the following host group could not be verified: [host group:All Hosts, host:</em><a href="http://ltlab.nablasoft.com"><em>ltlab.nablasoft.com</em></a><em>] TF259210: Team Foundation Server was unable to find the following network location: </em><a href="http://nablasoft.com"><em>nablasoft.com</em></a><em>, on a Hyper-V host </em><a href="http://ltlab.nablasoft.com"><em>ltlab.nablasoft.com</em></a><em>. Wait several minutes, and then pause or shutdown and start the environment try the operation again. If the problem persists, confirm the Hyper-V host is available on the network and has appropriate permissions configured for Team Foundation Server.</em></p>
</blockquote>
<p>The solution to this problem can be found following the instruction on the <a href="http://blogs.msdn.com/lab_management/archive/2009/06/08/networking-basics-for-lab-management-part-i.aspx">original post</a>, and it deals with configuration of the virtual networking. To solve this you can simply go to scvmm and verify the property of the host</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image17.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb17.png" width="479" height="312" /></a> </p>
<p>You need to be sure that you have a network location, in my situation it was blank, so I simply decide to override it. Here is the final configuration</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image18.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb18.png" width="546" height="264" /></a> </p>
<p>Now I had another problem, I already deployed the virtual machine with TFS 2010 beta, so I simply stopped it and verify its properties. I again verified that no network location is present so I use my nablasoft.com</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image19.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb19.png" width="459" height="596" /></a> </p>
<p>Now I start the machine again, go to tfs configuration and everything is ok. During setup of Lab Management, <a href="http://blogs.msdn.com/lab_management/pages/troubleshooting.aspx#e1_3">you can also refer to This post</a>, that contains some of the most common cause of errors during setup of lab management, along with the corresponding solution.</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Lab Management" rel="tag">Lab Management</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=lmSLzVcawAk:fDSqUdz-0KY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=lmSLzVcawAk:fDSqUdz-0KY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=lmSLzVcawAk:fDSqUdz-0KY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=lmSLzVcawAk:fDSqUdz-0KY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=lmSLzVcawAk:fDSqUdz-0KY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=lmSLzVcawAk:fDSqUdz-0KY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/lmSLzVcawAk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/23/configuring-lab-management-problem-with-network-location/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/23/configuring-lab-management-problem-with-network-location/</feedburner:origLink></item>
		<item>
		<title>Have you backup your data today?</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/LjZVYR1f9oA/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/17/have-you-backup-your-data-today/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 09:22:22 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Experiences]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/17/have-you-backup-your-data-today/</guid>
		<description><![CDATA[
			
				
			
		
I was reading this post, and I really agree with Jeff, every day is international Backup Awareness Day.
People usually learn the importance of a good backup the first time they have a great data loss, or when you see others having greats data loss. I remember, loong time ago, when I worked in a computer [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F17%2Fhave-you-backup-your-data-today%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F17%2Fhave-you-backup-your-data-today%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I was reading <a href="http://www.codinghorror.com/blog/archives/001315.html">this post</a>, and I really agree with Jeff, every day is international Backup Awareness Day.</p>
<p>People usually learn the importance of a good backup the first time they have a great data loss, or when you see others having greats data loss. I remember, loong time ago, when I worked in a computer shop in my city, one day a person came with his computer and told us “it does not power up”. I checked the machine and the Hard Disk was completely gone, it did not even spin the disk so I told him, “the HD is gone, all data are lost”. I remember this 50 years old man almost crying to me “I have 5 years of work inside the HD, tons of autocad project, I need those data”</p>
<p>That episode makes me understand the importance of your data, so every day I begin to think, what will happen if my internal HD will fry for catastrophic power supply peak voltage? What happens if a supermagnet will erase all the data of all my HD in home, etc etc.</p>
<p>I learned also the importance of verify the restore procedure, nothing is more dangerous of a false security, you think that you have a good backup, and when you need it….</p>
<p><img src="http://th01.deviantart.com/fs5/300W/i/2004/284/4/b/fiery_horror_by_sc4mp1.jpg" /></p>
<p>You will find that your backup is not so good, and you lost data or you are not able to recover all of your data.</p>
<p>Another important consideration is that you cannot rely on others making backup of your data. Data are YOURS and it is YOURS duty to backup them, especially if they are stored in some internet provider that gives you 5 GB of spaces for 50$ years.</p>
<p>For My blog I do regular database backup, I download via ftp the whole site periodically so I do not lose images, and I restore everything on a virtual machine of mine, and verify that the restored blog is ok, this gives me good confidence that if my provider completely lost all my data, I’m able to restore everything from the latest backup. Data of my blog, for each backup, are stored in multiple places.</p>
<p>1) on my host</p>
<p>2) on my external backup disk</p>
<p>3) on a virtual machine that resides into an internal disk.</p>
<p>Alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Bakcup Strategy" rel="tag">Bakcup Strategy</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=LjZVYR1f9oA:SBspzJJHM5M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=LjZVYR1f9oA:SBspzJJHM5M:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=LjZVYR1f9oA:SBspzJJHM5M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=LjZVYR1f9oA:SBspzJJHM5M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=LjZVYR1f9oA:SBspzJJHM5M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=LjZVYR1f9oA:SBspzJJHM5M:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/LjZVYR1f9oA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/17/have-you-backup-your-data-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/17/have-you-backup-your-data-today/</feedburner:origLink></item>
		<item>
		<title>Writing windows services, smoke test form</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/Z-ILOb0fVJQ/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/16/writing-windows-services-smoke-test-form/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 17:58:08 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Architecture]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/16/writing-windows-services-smoke-test-form/</guid>
		<description><![CDATA[
			
				
			
		
I work often with windows services, and one of the most painfully experience is that you do not have an UI and quite often they have to do some scheduled task at certain time, so whenever you have a deploy you can find yourself in this situation.
 
The question mark means that you are not [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F16%2Fwriting-windows-services-smoke-test-form%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F16%2Fwriting-windows-services-smoke-test-form%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I work often with windows services, and one of the most painfully experience is that you do not have an UI and quite often they have to do some scheduled task at certain time, so whenever you have a deploy you can find yourself in this situation.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image15.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb15.png" width="244" height="130" /></a> </p>
<p>The question mark means that you are not sure if your new deploy is really ok, because maybe some of the scheduled tasks will fail for misconfiguration or something else. Usually production machine are different to developement ones, you can miss components, point to a wrong db, forget to update configuration, etc, etc. To avoid this situation you need a series of smoke checks, I usually proceed in this way.</p>
<p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:61c9a360-447c-4ea6-b302-16c398e9a116" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> TestResult
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> Boolean Result { </span><span style="color: #0000FF;">get</span><span style="color: #000000;">; </span><span style="color: #0000FF;">set</span><span style="color: #000000;">; }
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> String Comment { </span><span style="color: #0000FF;">get</span><span style="color: #000000;">; </span><span style="color: #0000FF;">set</span><span style="color: #000000;">; }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> TestResult Ok </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> TestResult() {Result </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">};
}

</span><span style="color: #0000FF;">interface</span><span style="color: #000000;"> ITest
{
    TestResult Execute();
    String Name { </span><span style="color: #0000FF;">get</span><span style="color: #000000;">; }
}</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>This is the interface of the a component that is able to do a test, I can now write stuff like this </p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ff7f23e6-0637-44c6-a6aa-bd5eecedf28e" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> ResolveIoCTest: ITest
{
    </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> ITest Members</span><span style="color: #000000;">

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> TestResult Execute()
    {
        IoC.Resolve</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">IMYInterface</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">(</span><span style="color: #800000;">"</span><span style="color: #800000;">xxxxx</span><span style="color: #800000;">"</span><span style="color: #000000;">);
        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> TestResult.Ok;
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Name
    {
        </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">ResolveIoCTest</span><span style="color: #800000;">"</span><span style="color: #000000;">; }
    }

    </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;"> </span><span style="color: #000000;">
}</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Just to verify that I’m able to resolve a specific interface or a specific component, but you can actually verify every stuff you like, then I write a simple form with a button and a ritch text box.</p>
<p>The next step is finding in the assembly all test classes</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ee758acd-5cb5-47c9-842f-e3f71da04921" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #000000;">Type testInterfaceType </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(ITest);
IoC.FluentRegistration(
    AllTypes.Pick()
    .FromAssembly(
        Assembly.GetExecutingAssembly())
    .If(testInterfaceType.IsAssignableFrom)
    .Configure(reg </span><span style="color: #000000;">=&gt;</span><span style="color: #000000;"> reg.LifeStyle.Transient)
    .WithService.FirstInterface());</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Thanks to fluent registration it is easy to autoregister all test classes, now the test form simply call IoC.ResolveAll&lt;ITest&gt; and for each test execute it in a Try catch, and here is a typical result.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image16.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb16.png" width="636" height="315" /></a> </p>
<p>Some exception occurred. </p>
<p>Now each time I write a component that needs verification, I write a simple test, then each time I deploy I runs this form and verify that I do not miss anything. This saves me pain, because I know that at least a set of smoke tests are passing correctly.</p>
<p>alk.</p>
<p>Tags: <a href="http://technorati.com/tag/Software Architecture" rel="tag">Software Architecture</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Z-ILOb0fVJQ:OgQ3VKbN530:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Z-ILOb0fVJQ:OgQ3VKbN530:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Z-ILOb0fVJQ:OgQ3VKbN530:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=Z-ILOb0fVJQ:OgQ3VKbN530:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Z-ILOb0fVJQ:OgQ3VKbN530:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=Z-ILOb0fVJQ:OgQ3VKbN530:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/Z-ILOb0fVJQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/16/writing-windows-services-smoke-test-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/16/writing-windows-services-smoke-test-form/</feedburner:origLink></item>
		<item>
		<title>On a way to lab management – TF260078 error</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/mravqZJnOZM/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/13/on-a-way-to-lab-management-tf260078-error/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 08:07:35 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Lab Management]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/13/on-a-way-to-lab-management-tf260078-error/</guid>
		<description><![CDATA[
			
				
			
		
I’m configuring Lab Management in the virtual machine with the test contrller and TFS, but when it ask me for credentials to connect to System Center Virtual Machine Manager, I specify the credentials of Domain Admin and it gives me this error.
 
It is strange, because administrator is the user I currently use to manage [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F13%2Fon-a-way-to-lab-management-tf260078-error%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F13%2Fon-a-way-to-lab-management-tf260078-error%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I’m configuring Lab Management in the virtual machine with the test contrller and TFS, but when it ask me for credentials to connect to System Center Virtual Machine Manager, I specify the credentials of Domain Admin and it gives me this error.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image13.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb13.png" width="450" height="241" /></a> </p>
<p>It is strange, because administrator is the user I currently use to manage SCVMM, but maybe there is some restrictions to be used by the Lab management agent, so I decided to create a specific user in active directory called Labmanagement, and then goes to the administration tab of SCVMM and added to the admin role</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image14.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb14.png" width="713" height="257" /></a> </p>
<p>Now I return to the lab management configuration and everything works as expected.</p>
<p>alk.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b3114eaa-838d-4b5d-a43f-428be92dddf4" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Lab+Management" rel="tag">Lab Management</a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mravqZJnOZM:FdOHZd8YN24:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mravqZJnOZM:FdOHZd8YN24:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mravqZJnOZM:FdOHZd8YN24:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=mravqZJnOZM:FdOHZd8YN24:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mravqZJnOZM:FdOHZd8YN24:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=mravqZJnOZM:FdOHZd8YN24:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/mravqZJnOZM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/13/on-a-way-to-lab-management-tf260078-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/13/on-a-way-to-lab-management-tf260078-error/</feedburner:origLink></item>
		<item>
		<title>On a way to lab management</title>
		<link>http://feedproxy.google.com/~r/AlkampferEng/~3/ZDJO3phspHQ/</link>
		<comments>http://www.codewrecks.com/blog/index.php/2009/12/12/on-a-way-to-lab-management/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 08:40:39 +0000</pubDate>
		<dc:creator>alkampfer</dc:creator>
				<category><![CDATA[Visual Studio Team System]]></category>
		<category><![CDATA[Lab Management]]></category>

		<guid isPermaLink="false">http://www.codewrecks.com/blog/index.php/2009/12/12/on-a-way-to-lab-management/</guid>
		<description><![CDATA[
			
				
			
		
I’m installing Lab Management, and since it is a complex environment some problems can arise. I’m following the four part tutorial that you can find here, and this morning I face the first problem.
When I try to add my Hyper-V host to the Vitual Machine Manager (SCVMM) I have this problem.
 
As you can see, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F12%2Fon-a-way-to-lab-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codewrecks.com%2Fblog%2Findex.php%2F2009%2F12%2F12%2Fon-a-way-to-lab-management%2F&amp;source=alkampfer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I’m installing Lab Management, and since it is a complex environment some problems can arise. I’m following the four part tutorial that <a href="http://blogs.msdn.com/lab_management/archive/2009/11/18/Getting-started-with-Lab-Management-_2800_Part-1_2900_.aspx">you can find here</a>, and this morning I face the first problem.</p>
<p>When I try to add my Hyper-V host to the Vitual Machine Manager (SCVMM) I have this problem.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image11.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb11.png" width="630" height="311" /></a> </p>
<p>As you can see, when I try to add an Hyper-V enabled machine (The same where SCVMM is running) it tells me that virtualization software is Unknown, even if hyper-V is up and running fine.</p>
<p>To address such problem, you need to install a couple of programs, the first one is the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=DB70824D-ABAE-4A92-9AA2-1F43C0FA49B3&amp;displaylang=en">Microsoft Baseline Configuration Analyzer</a>, that is needed to install and run System Center <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=02d83950-c03d-454e-803b-96d1c1d5be24&amp;displaylang=en#filelist">Virtual Machine Manager configuration Analyzer</a>. In my situation I immediately see an error.</p>
<p><a href="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image12.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.codewrecks.com/blog/wp-content/uploads/2009/12/image_thumb12.png" width="373" height="231" /></a> </p>
<p>I installed IIS, but this does not solve my problem, So I checked event log, and I see some strange errors related to hper-V (14050), and <a href="http://www.aspdeveloper.net/tiki-index.php?page=VirtualServerEvents_14050">I found some information he</a>re. I check my network settings, correct a little problem and then trying again to add the machine. The error was still there, the machine has “Unknown” virtualization software. My only possibility was to continue the installation, asking to SCVMM to enable hyper-v role. When I finish the operation the script runs fine, it enabled instantaneously the Hyper-V role (it was already up and running) and the installation went good.</p>
<p>alk.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b9e2e8be-8197-4687-a346-58bc536eb30d" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Lab+Management" rel="tag">Lab Management</a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZDJO3phspHQ:N7RYmjEmay8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZDJO3phspHQ:N7RYmjEmay8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZDJO3phspHQ:N7RYmjEmay8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?i=ZDJO3phspHQ:N7RYmjEmay8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZDJO3phspHQ:N7RYmjEmay8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AlkampferEng?a=ZDJO3phspHQ:N7RYmjEmay8:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/AlkampferEng?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AlkampferEng/~4/ZDJO3phspHQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codewrecks.com/blog/index.php/2009/12/12/on-a-way-to-lab-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codewrecks.com/blog/index.php/2009/12/12/on-a-way-to-lab-management/</feedburner:origLink></item>
	</channel>
</rss>
