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

<channel>
	<title>Sander van Vliet</title>
	<atom:link href="http://barad-dur.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://barad-dur.nl</link>
	<description>Land Rovers, .Net en meer!</description>
	<lastBuildDate>Fri, 11 Nov 2011 07:46:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>VS2010 HatPackage did not load correctly</title>
		<link>http://barad-dur.nl/net/vs2010-hatpackage-did-not-load-correctly/</link>
		<comments>http://barad-dur.nl/net/vs2010-hatpackage-did-not-load-correctly/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 07:46:15 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=204</guid>
		<description><![CDATA[This morning when I started Visual Studio 2010 it threw a wobbly at me. It seemed the Microsoft.VisualStudio.TeamFoundation.VersionControl.HatPackage did not load correctly. Of course I tried to Google for this error but I was unable to find anything useful apart from trying to repair the Visual Studio installation. Fortunately I have the /Log option set <a href="http://barad-dur.nl/net/vs2010-hatpackage-did-not-load-correctly/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>This morning when I started Visual Studio 2010 it threw a wobbly at me. It seemed the Microsoft.VisualStudio.TeamFoundation.VersionControl.HatPackage did not load correctly. Of course I tried to Google for this error but I was unable to find anything useful apart from trying to repair the Visual Studio installation. Fortunately I have the /Log option set in the shortcut so I had a logfile with the errors. Unfortunately, apart from the error that the package did not load the log contained nothing useful.</p>
<p>After trying a few times (hoping it would go away) there was one time where a dialog popped up with a reference to a file called VersionControl.config. Needless to say I clicked it away before I could actually read it but at least now I had a filename and a little more information.</p>
<p>The file is located in %UserProfile%\Local Settings\Application Data\Microsoft\Team Foundation\3.0\Cache and as Visual Studio told me, it contained nothing but garbage. As all Microsoft .config files contain XML I figured this to be the problem I deleted the file and restarted Visual Studio: problem solved!</p>
<p>So, if you happen to encounter the error:</p>
<pre>The 'Microsoft.VisualStudio.TeamFoundation.VersionControl.HatPackage, Microsoft.VisualStudio.TeamFoundation.VersionControl, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' package did not load correctly.</pre>
<p><a href="http://barad-dur.nl/wp-content/uploads/2011/11/hatpackage-fail.png" rel="lightbox[204]"><img class="alignnone size-full wp-image-206" title="hatpackage-fail" src="http://barad-dur.nl/wp-content/uploads/2011/11/hatpackage-fail.png" alt="" width="618" height="149" /></a></p>
<p>You should check the VersionControl.config file before resorting to a Visual Studio reinstallation.</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/vs2010-hatpackage-did-not-load-correctly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TFDP &#8211; T4 For Database Projects</title>
		<link>http://barad-dur.nl/net/c-4-0/tfdp-t4-for-database-projects/</link>
		<comments>http://barad-dur.nl/net/c-4-0/tfdp-t4-for-database-projects/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 16:16:12 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[T4]]></category>
		<category><![CDATA[TFDP]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[VSTDB]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=191</guid>
		<description><![CDATA[After working on this for some time, I&#8217;ve decided that it was time to publish TFDP to a wider audience. TFDP provides T4 template processing in Visual Studio 2010 database projects. Something that isn&#8217;t possible in the current versions. The extension can be found in the Visual Studio Gallery and on Codeplex.]]></description>
			<content:encoded><![CDATA[<p>After working on this for some time, I&#8217;ve decided that it was time to publish TFDP to a wider audience. TFDP provides T4 template processing in Visual Studio 2010 database projects. Something that isn&#8217;t possible in the current versions.</p>
<p>The extension can be found in the <a title="TFDP on the Visual Studio Gallery" href="http://visualstudiogallery.msdn.microsoft.com/c7ae9467-b464-405f-b01d-f6f97a595782" target="_blank">Visual Studio Gallery</a> and on <a title="TFDP on Codeplex" href="http://tfdp.codeplex.com/" target="_blank">Codeplex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/c-4-0/tfdp-t4-for-database-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Export Locals</title>
		<link>http://barad-dur.nl/net/export-locals/</link>
		<comments>http://barad-dur.nl/net/export-locals/#comments</comments>
		<pubDate>Wed, 11 May 2011 06:00:09 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=174</guid>
		<description><![CDATA[Introduction: In this forum thread (warning: Dutch) someone was complaining that it&#8217;s not really easy to export the contents of the Locals debug window to a XML file. I&#8217;ve neved had the need for that myself but I thought, it can&#8217;t be that hard. Turns out it isn&#8217;t. I&#8217;ve written a VS2010 add-in that adds <a href="http://barad-dur.nl/net/export-locals/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<h2>Introduction:</h2>
<p>In this <a href="http://gathering.tweakers.net/forum/list_message/36005948#36005948" target="_blank">forum thread</a> (warning: Dutch) someone was complaining that it&#8217;s not really easy to export the contents of the Locals debug window to a XML file. I&#8217;ve neved had the need for that myself but I thought, it can&#8217;t be that hard. Turns out it isn&#8217;t.</p>
<p>I&#8217;ve written a VS2010 add-in that adds a menu item to the Tools menu in Visual Studio that will export all the locals for the current stack frame and open the XML file in Visual Studio. As always a picture says more than a thousand words so see for yourself:</p>
<p>A program in debug mode, notice the Locals window in the left bottom:</p>
<p><a href="http://barad-dur.nl/wp-content/uploads/2011/05/debug1.png" rel="lightbox[174]"><img class="alignnone size-medium wp-image-175" title="debug1" src="http://barad-dur.nl/wp-content/uploads/2011/05/debug1-300x204.png" alt="" width="300" height="204" /></a></p>
<p>Export the locals via the menu option:</p>
<p><a href="http://barad-dur.nl/wp-content/uploads/2011/05/debug2.png" rel="lightbox[174]"><img class="alignnone size-medium wp-image-176" title="debug2" src="http://barad-dur.nl/wp-content/uploads/2011/05/debug2-300x204.png" alt="" width="300" height="204" /></a></p>
<p>The exported XML document is opened in Visual Studio:</p>
<p><a href="http://barad-dur.nl/wp-content/uploads/2011/05/debug3.png" rel="lightbox[174]"><img class="alignnone size-medium wp-image-177" title="debug3" src="http://barad-dur.nl/wp-content/uploads/2011/05/debug3-300x204.png" alt="" width="300" height="204" /></a></p>
<p>For now it will export to 2 levels deep, any more than that will make it incredibly slow.</p>
<h2>Downloads:</h2>
<p>The VSIX can be downloaded here: <a href="http://barad-dur.nl/wp-content/uploads/2011/05/ExportLocals.vsix">ExportLocals.vsix</a></p>
<p>The sources can be downloaded here: <a href="http://barad-dur.nl/wp-content/uploads/2011/05/ExportLocals.zip">ExportLocals.zip</a></p>
<p>Or you can install the add in via the <a href="http://visualstudiogallery.msdn.microsoft.com/4f15c2aa-58f1-4323-b0f5-a2663142cd51" target="_blank">Visual Studio Gallery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/export-locals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom WSDL for WCF Workflow Service</title>
		<link>http://barad-dur.nl/net/wcf-workflow-service/</link>
		<comments>http://barad-dur.nl/net/wcf-workflow-service/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 09:17:52 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WF]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=165</guid>
		<description><![CDATA[I&#8217;m currently working on a webservice layer for our main application so we can interface with our existing BizTalk applications. Because I like using new technologies I&#8217;ve decided to use WCF Workflow services to implement the logic of these services. With WF4 and the FlowDiagram features it&#8217;s very easy to do this and really, really <a href="http://barad-dur.nl/net/wcf-workflow-service/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a webservice layer for our main application so we can interface with our existing BizTalk applications. Because I like using new technologies I&#8217;ve decided to use WCF Workflow services to implement the logic of these services. With WF4 and the FlowDiagram features it&#8217;s very easy to do this and really, really quick to build the services.</p>
<p>One slight problem I&#8217;ve discovered is that the C# types we use in the ReceiveRequest activity are generated from a custom XSD and the WSDL generated by the workflow service doesn&#8217;t reference that schema but generates a new one. Normally this isn&#8217;t that much of a problem, simply create a custom WSDL and set the externalMetadataLocation option in the web.config:</p>
<pre>&lt;behavior name="MyServiceBehavior"&gt;
   &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
   &lt;serviceMetadata httpGetEnabled="true" externalMetadataLocation="../MyService.wsdl" /&gt;
&lt;/behavior&gt;</pre>
<p>Contrary to popular belief, this doesn&#8217;t work! The workflow service still gives it&#8217;s WSDL as being MyService.xamlx?wsdl instead of the custom WSDL. After some Google-ing (is that a word?) I found that there was something missing: a binding. More specific: a mexHttpBinding. It seems that without specifying the Metadata Exchange the workflow service will continue to provide it&#8217;s own idea of the WSDL and ignores the WSDL specified in the externalMetadataLocation.</p>
<p>Fortunately the fix is easy. Add a new endpoint to the service configuration that uses the mexHttpBinding:</p>
<pre>&lt;service name="MyService" behaviorConfiguration="MyServiceBehavior"&gt;
   &lt;endpoint binding="mexHttpBinding" contract="IMetadataExchange" address="mex" /&gt;
&lt;/service&gt;</pre>
<p>After adding this and refreshing the workflow service in the browser it now correctly shows the custom WSDL!</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/wcf-workflow-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net 4.0 WinForm Data Binding bug</title>
		<link>http://barad-dur.nl/net/net-4-0-winform-data-binding-bug/</link>
		<comments>http://barad-dur.nl/net/net-4-0-winform-data-binding-bug/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 09:37:35 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C# 4.0]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=158</guid>
		<description><![CDATA[Currently I&#8217;m busy with converting a .Net 2.0 WinForms application to .Net 4.0 in VS2010. Seemed to work pretty smooth but when testing one of the more complex windows in the application I hit a snag. Upon opening the window I got a &#8220;TargetException: Object does not match target type.&#8221; thrown in my face. After <a href="http://barad-dur.nl/net/net-4-0-winform-data-binding-bug/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Currently I&#8217;m busy with converting a .Net 2.0 WinForms application to .Net 4.0 in VS2010. Seemed to work pretty smooth but when testing one of the more complex windows in the application I hit a snag. Upon opening the window I got a &#8220;TargetException: Object does not match target type.&#8221; thrown in my face. After a quick tour with the debugger I found the problem: data binding didn&#8217;t work anymore!</p>
<p>To find out what the real problem was I&#8217;ve built a test application that basically does the same thing as the complex window that is giving me such a headache.<span id="more-158"></span> So here goes:</p>
<p>I have a class like this:</p>
<pre>public class Base {
    public string Property1 { get; set; }
    public Sub SubItem { get; set; }

    public Base() {
        Property1 = "Base Property1";
        SubItem = new Sub();
}
public class Sub {
    public string Property1 { get; set; }

    public Sub() {
        Property1 = "Sub Property1";
    }
}
</pre>
<p>Which is bound to a TextBox:</p>
<pre>private void buttonBind_Click(object sender, EventArgs e) {
    Base b = new Base();

    // This works
    textBox1.DataBindings.Add("Text", b.SubItem, "Property1");

    // This doesn't work
    textBox2.DataBindings.Add("Text", b, "SubItem.Property1");
}
</pre>
<p>Now the first binding will work but the second one will throw a TargetException. I have no clue why this happens but the message of the exception and the stack trace give some hints that this is a reflection problem. However the binding specifies to bind a string property to a string property so that shouldn&#8217;t be a problem.</p>
<p>A workaround for this problem is to use a BindingSource:</p>
<pre>private void buttonBind_Click(object sender, EventArgs e) {
    Base b = new Base();
    BindingSource bs = new BindingSource(b, null); // Use a empty datamember

    // Now it will work
    textBox2.DataBindings.Add("Text", bs, "SubItem.Property1");
}</pre>
<p>But it&#8217;s quite a lot of work to replace this in the current application so I hope this gets fixed soon.</p>
<p>In the meanwhile I&#8217;ve filed a bug report at Microsoft Connect (see <a href="https://connect.microsoft.com/VisualStudio/feedback/details/552853/net-4-0-simple-binding-issue?wa=wsignin1.0" target="_blank">here</a>) with sample code that demonstrates the behavior so you can test for yourself. If you do, please vote on Microsoft Connect to get it under their attention!</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/net-4-0-winform-data-binding-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TwitCast</title>
		<link>http://barad-dur.nl/net/twitcast/</link>
		<comments>http://barad-dur.nl/net/twitcast/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:28:22 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[LINQ To Twitter]]></category>
		<category><![CDATA[TwitCast]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=147</guid>
		<description><![CDATA[What started it Are you using Twitter? Do you like it or absolutely loathe it? I do like it but one thing I don’t like is constantly checking twitter.com to see if someone tweeted something interesting. So a new idea was born and the wasting of time began. The idea Actually it’s pretty simple, I <a href="http://barad-dur.nl/net/twitcast/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<h3>What started it</h3>
<p>Are you using Twitter? Do you  like it or absolutely loathe it? I do like it but one thing I don’t like is  constantly checking twitter.com to see if someone tweeted something interesting. So  a new idea was born and the wasting of time began.</p>
<h3>The idea</h3>
<p>Actually it’s pretty simple, I  wanted an application that showed a pop-up of some kind that shows me the latest  tweet for a minute or so and then disappear, similar to the new e-mail popup  of Outlook. Another feature I wanted to make is that when I mouse over on  the pop-up the app shows me the last 10 tweets from my timeline.</p>
<h3>Problem #1</h3>
<p>First things first, how to get  the last tweets from Twitter? As all programmers are lazy (see <a href="http://blogoscoped.com/archive/2005-08-24-n14.html">http://blogoscoped.com/archive/2005-08-24-n14.html</a>) I’ve started looking for a library that could do this  for me. Lo’ and behold: <a title="LINQ To Twitter" href="http://linqtotwitter.codeplex.com/" target="_blank">LINQ To Twitter</a>. A wrapper around the Twitter web services written by <a title="Joe Mayo's blog" href="http://geekswithblogs.net/WinAZ/Default.aspx" target="_blank">Joe Mayo</a> (Microsoft  MVP) in C#.</p>
<p>So, problem #1 was solved.</p>
<h3>Problem #2</h3>
<p>The next problem was one of UI.  How to display a nice pop-up that gives access to the rest of the application?  What I wanted to do is create a window that slides in from the top of the  screen when a new Tweet is posted and when the mouse is over it, expand to show the  last 10 tweets. Because a default window border doesn’t look all that nice I’ve  decided to use a transparent window:</p>
<table style="height: 316px;" border="0" cellspacing="0" cellpadding="0" width="700">
<tbody>
<tr>
<td width="307" valign="top"><a href="http://barad-dur.nl/wp-content/uploads/2010/03/twitcast-screen.png" rel="lightbox[147]"><img class="alignnone size-full wp-image-148" title="twitcast-screen" src="http://barad-dur.nl/wp-content/uploads/2010/03/twitcast-screen.png" alt="" width="304" height="191" /></a></td>
<td width="307" valign="top"><strong>XAML:</strong></p>
<pre>&lt;Window

 Background="Transparent"
 AllowsTransparency="True"&gt;
 &lt;Grid&gt;
  &lt;Border&gt;
   &lt;ScrollViewer&gt;
    &lt;ItemsControl /&gt;
   &lt;/ScrollViewer&gt;
  &lt;/Border&gt;
 &lt;/Grid&gt;
&lt;/Window&gt;
</pre>
</td>
</tr>
</tbody>
</table>
<p>As you can see it’s a pretty  simple UI but that’s exactly what I wanted. What you see is a transparent Window with a Border and ScrollViewer (the green bit) that hosts an ItemsControl,  nothing fancy so far. The next step was to set the initial position of the  window. A simple RenderTransform took care of that:</p>
<p><strong>XAML:</strong></p>
<pre>&lt;Border.RenderTransform&gt;
&lt;TranslateTransform Y="-360"  /&gt;
&lt;/Border.RenderTransform&gt;
</pre>
<p>The ItemTemplate of the tweets  is also quite straightforward:</p>
<p><strong>XAML:</strong></p>
<pre>&lt;DataTemplate&gt;
  &lt;Border&gt;
    &lt;StackPanel Orientation="Vertical"&gt;
      &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Left"&gt;
        &lt;TextBlock Text="{Binding Path=User.Name}" /&gt;
        &lt;TextBlock Text=" at " /&gt;
        &lt;TextBlock Text="{Binding Path=CreatedAt}" /&gt;
      &lt;/StackPanel&gt;
      &lt;TextBlock Text="{Binding Path=Text}" TextWrapping="Wrap" /&gt;
    &lt;/StackPanel&gt;
  &lt;/Border&gt;
&lt;/DataTemplate&gt;
</pre>
<p>The result looks like this:</p>
<p><a href="http://barad-dur.nl/wp-content/uploads/2010/03/image002.jpg" rel="lightbox[147]"><img class="alignnone size-full wp-image-152" title="image002" src="http://barad-dur.nl/wp-content/uploads/2010/03/image002.jpg" alt="" width="375" height="66" /></a></p>
<h3>Fancy UI</h3>
<p>The important part of the  application was to “popup” (or down actually) when a new tweet is available and when the  mouse enters the application so all tweets are shown. To do this three  storyboards are needed:</p>
<p>1.       Animate to the new tweet view</p>
<p>2.       Animate to the full view</p>
<p>3.        Animate to the hidden view</p>
<p>The storyboards all animate the RenderTransform of the Border that hosts the controls.</p>
<p><strong>XAML:</strong></p>
<pre>&lt;Storyboard  x:Key="Hidden"&gt;
  &lt;DoubleAnimation
    Storyboard.TargetProperty="Opacity"
    To="0.4"
    Duration="0:0:0.2" /&gt;
  &lt;DoubleAnimation Storyboard.TargetProperty="(Border.RenderTransform).(TranslateTransform.Y)"
    To="-370"
    Duration="0:0:0.2"
    BeginTime="0:0:0.2" /&gt;
&lt;/Storyboard&gt;
&lt;Storyboard x:Key="NewTweet"&gt;
  &lt;DoubleAnimation Storyboard.TargetProperty="(Border.RenderTransform).(TranslateTransform.Y)"
    To="-295"
    Duration="0:0:0.2" /&gt;
   &lt;DoubleAnimation
    Storyboard.TargetProperty="Opacity"
    To="1"
    Duration="0:0:0.2" /&gt;
&lt;/Storyboard&gt;
&lt;Storyboard x:Key"AllTweets"&gt;
  &lt;DoubleAnimation Storyboard.TargetProperty="(Border.RenderTransform).(TranslateTransform.Y)"
    To="-20"
    Duration="0:0:0.2" /&gt;
  &lt;DoubleAnimation
    Storyboard.TargetProperty="Opacity"
    To="1"
    Duration="0:0:0.2" /&gt;
&lt;/Storyboard&gt;
</pre>
<p>These storyboards are started  by various events in the application. For example: MouseEnter and MouseLeave on the  Border trigger the AllTweets and Hidden Storyboards.</p>
<h3>Timeline</h3>
<p>So far so good, the UI is  basically finished and all that remains is to fill the application with the tweets  from my timeline. For this I’ve created a Timeline class that contains the TwitterContext and a simple timer for the refresh action. The grunt of  this class is the following LINQ statement:</p>
<p><strong>LINQ:</strong></p>
<pre>var statusTweets =
from tweet in  this.context.Status
where tweet.Type == statusType
            &amp;&amp; tweet.ScreenName == this.screenName
            &amp;&amp; tweet.Count == maximumTweetsPerRefresh
            &amp;&amp; tweet.CreatedAt &gt; lastTweetDate
select tweet;
</pre>
<p>This statement will retrieve all tweets from the timeline specified with  screenName that have been created  since the last refresh.  If this results in 1 or more tweets the Timeline class will raise the NewTweetsAvailable event to notify the application that new tweets are  available to display.</p>
<p>The event handler simply pushes the new tweets to the ItemsControl and starts the NewTweet storyboard to  pop-down the window so the latest tweet is visible.</p>
<h3>Wrap up</h3>
<p>As you can see it’s really  simple to build an application that shows the latest tweets in your Twitter timeline. Of  course there are a few features that are missing, for example the storyboards,  but I’ll blog about them a bit later. Be sure to check <a title="TwitCast on Twitter" href="http://twitter.com/#search?q=%23TwitCast" target="_blank">#TwitCast</a> for updates</p>
<p><strong>Update:</strong></p>
<p>TwitCast is now listed on Codeplex at <a title="TwitCast CodePlex project page" href="http://twitcast.codeplex.com/" target="_blank">http://twitcast.codeplex.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/twitcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TFS2010 VSSConverter woes</title>
		<link>http://barad-dur.nl/net/tfs2010-vssconverter-woes/</link>
		<comments>http://barad-dur.nl/net/tfs2010-vssconverter-woes/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 10:12:06 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Team Foundation Server 2010]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[VSSConverter]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=134</guid>
		<description><![CDATA[Yesterday I&#8217;ve been busy installing the Beta 2 of Team Foundation Server 2010 to do some testing and to see if we can switch (yay go-live!). And in fact the installing went pretty smooth so the work Microsoft has been doing is really great. Unfortunately when I decided it was time to move our Visual <a href="http://barad-dur.nl/net/tfs2010-vssconverter-woes/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I&#8217;ve been busy installing the Beta 2 of Team Foundation Server 2010 to do some testing and to see if we can switch (yay go-live!). And in fact the installing went pretty smooth so the work Microsoft has been doing is really great.</p>
<p>Unfortunately when I decided it was time to move our Visual Source Safe database to TFS all went sour. The analysis of the VSS database with the VSSConverter tool worked but when I tried to migrate it just sat there and told me:</p>
<p><span>TF60070: Unable to connect to the Team Foundation Server: &#8216;http://ts01:8080/&#8217;. Please ensure that the Team Foundation Server exists and try again.</span></p>
<p><span>At first it seemed logical as the TFS is at http://ts01:8080/<strong>tfs</strong> so no worries there, just a bad config. Unfortunately there is no option in the configuration file to specify a full URL so basically I&#8217;m stuck. (<strong>small update:</strong> I tried to be clever and use URL redirection but it doesn&#8217;t work)<br />
</span></p>
<p><span>I&#8217;ve filed a bug on the <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=500032" target="_blank">Microsoft Connect</a> site so if you&#8217;re having the same problem please vote for it so they&#8217;ll start to fix it.</span></p>
<p><span><strong>Update 1: </strong>It seems that in Beta 1 the VSSConverter tool is unsupported. See the blog post from granth <a href="http://blogs.msdn.com/granth/archive/2009/05/20/visual-studio-team-system-2010-team-foundation-server-beta-1-installation-problems.aspx" target="_blank">here</a>, about half-way on the page</span></p>
<p><span><strong>Update 2: </strong><span style="text-decoration: line-through;">Someone has <a href="http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/de4d9dcc-6140-4f04-a397-c664384f847a" target="_blank">been successful</a> but with the VS2008 version of VSSConverter</span> Nope, he was not.</span></p>
<p><span><strong>Update 3:</strong> Matthew Mitrick (from Microsoft) has a good answer to this. You can read about it <a href="http://social.msdn.microsoft.com/Forums/en-US/tfsprerelease/thread/f4066269-d6b9-4fe0-84a8-ffaf619f0dd4/" target="_blank">here</a>.</span></p>
<p><span>The answer is that in the TFS 2010 Beta 2 there is a new feature called Collections. Unfortunately the documentation of VSSConverter has not been updated as there is a new configuration option to specify in which collection the projects should be migrated. So the solution is to add the option &#8220;</span>collection&#8221; to the TeamFoundationServer element in the options.xml so it looks something like this:</p>
<pre>&lt;TeamFoundationServer name="myserver" port="8080" protocol="http"
collection="tfs/DefaultCollection"&gt;&lt;/TeamFoundationServer&gt;</pre>
<p>If you&#8217;ve installed TFS in another virtual directory than <strong>tfs</strong> you should modify the collection option accordingly. (Goes for the collection as well <img src='http://barad-dur.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/tfs2010-vssconverter-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Binding a WPF DataGridColumn to a LINQ result</title>
		<link>http://barad-dur.nl/net/binding-a-wpf-datagridcolumn-to-a-linq-result/</link>
		<comments>http://barad-dur.nl/net/binding-a-wpf-datagridcolumn-to-a-linq-result/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 14:42:49 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=117</guid>
		<description><![CDATA[I&#8217;ve been tinkering with Visual Studio 2010 Beta1 and the .Net 4 framework. One of the things that I&#8217;ve tried is filling a DataGrid with the results of a LINQ query. Consider the following code: C# var voyages = from voyage in entities.Voyage select new { Number = voyage.Number, ETA = voyage.StartTime }; dataGridTest.ItemsSource = <a href="http://barad-dur.nl/net/binding-a-wpf-datagridcolumn-to-a-linq-result/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been tinkering with Visual Studio 2010 Beta1 and the .Net 4 framework. One of the things that I&#8217;ve tried is filling a DataGrid with the results of a LINQ query.<br />
Consider the following code:<br />
<strong>C#</strong></p>
<pre>var voyages = from voyage in entities.Voyage
              select new { Number = voyage.Number, ETA = voyage.StartTime };

dataGridTest.ItemsSource = voyages;</pre>
<p><strong>XAML</strong></p>
<pre>&lt;DataGrid Name="dataGridTest"&gt;
    &lt;DataGrid.Columns&gt;
        &lt;DataGridTextColumn Header="Number" Binding="{Binding Path=Number}" /&gt;
        &lt;DataGridTextColumn Header="ETA" Binding="{Binding Path=ETA}" /&gt;
    &lt;/DataGrid.Columns&gt;
&lt;/DataGrid&gt;</pre>
<p>Seems straightforward enough, doesn&#8217;t it? Well it does but when you try to run it, it&#8217;ll crash and burn with the following exception:</p>
<blockquote><p><strong>InvalidOperationException:</strong> A TwoWay or OneWayToSource binding cannot work on the read-only property &#8216;Number&#8217;</p></blockquote>
<p>The reason that the InvalidOperationException gets thrown is that the Binding used to bind the column to a property is a TwoWay binding, <strong>by default!</strong></p>
<p>But why should (and is) this be a problem? Well, because the result from the LINQ is a new class that contains only get-properties. This is by design because an anonymous type can only contain get-only properties as is written on <a title="MSDN - Anonymous Types" href="http://msdn.microsoft.com/en-us/library/bb397696.aspx" target="_blank">MSDN</a>:</p>
<blockquote><p>Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to first explicitly define a type.</p></blockquote>
<p>There are two workarounds for this problem, one is simply to add <code>Mode=OneWay</code> to the Binding property of the DataGridTextColumn. This will tell the DataGrid (ultimately the Binding) that it should not attempt to write data back to the bound object.</p>
<p>The other workaround is not to use an anonymous type. If you need to be able to change data in the result set this is probably the way to go. By defining a type that contains the properties you want to bind on you can tell LINQ to return that specific type and not an anonymous one.</p>
<p>For example:</p>
<p><strong>C#</strong></p>
<pre>public class VoyageResult {
    public int Number { get; set; }
    public DateTime ETA { get; set; }
}
var voyages = from voyage in entities.Voyage
              select new VoyageResult()
              {
                   Number = voyage.Number,
                   ETA = voyage.StartTime
              };</pre>
<p>voyages will now contain a list of VoyageResults instead of a generated anonymous type (with exactly the same properties!) If you bind this list to the DataGrid it will use the default TwoWay binding without complaints.</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/binding-a-wpf-datagridcolumn-to-a-linq-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone, youPhone?</title>
		<link>http://barad-dur.nl/algemeen/iphone-youphone/</link>
		<comments>http://barad-dur.nl/algemeen/iphone-youphone/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:42:28 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Algemeen]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=114</guid>
		<description><![CDATA[een beetje vreemd is het wel een microsoft ontwikkelaar die geen windows mobile telefoon heeft. Je zou haast kunnen zeggen dat het heulen met de vijand is. Eigenlijk heeft het nog een doel ook en dat is laten zien dat je zelfs op het Apple platform .Net applicaties kunt bouwen. Eerst maar eens verder spelen <a href="http://barad-dur.nl/algemeen/iphone-youphone/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>een beetje vreemd is het wel een microsoft ontwikkelaar die geen windows mobile telefoon heeft. Je zou haast kunnen zeggen dat het heulen met de vijand is.<br />
Eigenlijk heeft het nog een doel ook en dat is laten zien dat je zelfs op het Apple platform .Net applicaties kunt bouwen.<br />
Eerst maar eens verder spelen voordat ik me daar aan ga wagen.<br />
Oh en voor diegenen die al langer op een berichtje van mij zitten te wachten: eind van het weekend komt er wat aan dus even geduld nog. </p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/algemeen/iphone-youphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bikkelen!</title>
		<link>http://barad-dur.nl/algemeen/bikkelen/</link>
		<comments>http://barad-dur.nl/algemeen/bikkelen/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 20:45:50 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[Algemeen]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=90</guid>
		<description><![CDATA[3! 2! 1! duwen!! Dikke kluiten modder vliegen in het rond en dan staat die auto toch mooi boven op de heuvel. Aldus een korte samenvatting van het Bikkelweekend van de LRCH. Dit keer met een andere bijrijder dan normaal omdat Jelle, bezige baas als ie is, dit keer niet mee kon omdat ie weer <a href="http://barad-dur.nl/algemeen/bikkelen/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>3! 2! 1! duwen!! Dikke kluiten modder vliegen in het rond en dan staat die auto toch mooi boven op de heuvel. Aldus een korte samenvatting van het Bikkelweekend van de <a title="Land Rover Club Holland" href="http://www.lrch.nl/" target="_blank">LRCH</a>. Dit keer met een andere bijrijder dan normaal omdat Jelle, bezige baas als ie is, dit keer niet mee kon omdat ie weer eens moest werken. Gelukkig was <a href="http://jo-hn-ny.hyves.nl/" target="_blank">Johnny</a>, professioneel boomklouteraar, wel te porren voor een weekendje Land Rover geweld. En dat het echt bikkelen was bleek wel waar (en vooral hoe laat) we moesten verzamelen: 9 uur &#8216;s ochtends bij Schaap in Lelystad! En omdat met een groepje rijden altijd beter is dan in je eentje ben ik met Robert, Jan, Harm en Sophie om 7 uur vanaf Ridderkerk vertrokken. Ergens halverwege werden Harm en Sophie de rook van mijn trouwe serie 3 toch een beetje zat en werd ik wild ingehaald. Eenmaal bij Schaap aangekomen werd ons een envelop overhandigd met een kaartje met daarop de locaties waar we een aantal proeven moesten afleggen. &#8216;s Avonds op het campingterrein (nou ja, grasveld) werden de teams bekend gemaakt voor de trophy en gingen de team-opdrachten van start, vuurtje stoken, eiergooien, lopende-A en natuurlijk het succesnummer touwtrekken! Bij dat laatste heeft team 1 overtuigend de avond-overwinning binnen gesleept! Na een bijzonder koude nacht (onder het vriespunt) en een brommende standkachel was het dan tijd voor het spelen in de modder! Bij de 1e proef bleek al dat het niet zomaar zou gaan lukken en dat sommige boompjes toch wel erg dicht op elkaar staan en je ineens 8 dodehoekspiegels erbij hebt. Bij de op 1 na laatste proef die we gedaan hebben was Robert zo sportief om z&#8217;n auto even in de drek te parkeren waardoor team 1 op onnavolgbare wijze al touwtrekkend hem weer los probeerde te trekken. Anyhoe: een filmpje zegt meer dan de platte tekst dus aanschouw:</p>
<div style="text-align:center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Wrcq_1rBaQ8&amp;hl=nl&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/Wrcq_1rBaQ8&amp;hl=nl&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<div><a style="margin: 4px; float: right; position: relative; width: 150px;" rel="lightbox" href="http://barad-dur.nl/wp-content/uploads/2009/02/hat.jpg"><img title="hoed" src="http://barad-dur.nl/wp-content/uploads/2009/02/hat.jpg" alt="hat" width="150" /></a>Eenmaal terug in de beschaving en het &#8220;gewone&#8221; leven valt er ook nog genoeg te beleven. Vorige week vrijdag hoor je dan ineens dat de economische crisis toch ook dichtbij mensen raakt en dat Leon plotsklaps werkeloos is. De Dump bleek namelijk failliet te zijn gegaan. De uitspraak dat elk nadeel dan weer z&#8217;n voordeel heeft blijkt dan ook weer op te gaan omdat alles met 50% korting weg ging. Naast wat andere zaken heb ik dan eindelijk een rete coole hoed gekocht <img src='http://barad-dur.nl/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Ik lijk op het moment <em>zo</em> uit Australië te komen en familie te zijn van Crocodile Dundee.</div>
<p>Afgelopen week heb ik op m&#8217;n werk ook mijn review gehad en daar heb ik boven verwachting gescoord dus dat is weer goed voor m&#8217;n ego. Hopelijk zit daar ook nog een verbetering in van de materiele waardering maar dat zien we nog wel. Nu het voorjaar weer voor de deur staat heb ik het afgelopen weekend aangegrepen om m&#8217;n schuur eens grondig uit te mesten en de stadswerf te verblijden met al mijn ouwe troep <img src='http://barad-dur.nl/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Toen ik dat eenmaal voor elkaar had ben ik in 1x door gegaan naar m&#8217;n werkkamer (dat moet het worden eigenlijk) en de &#8220;geweldige&#8221; lambrisering die er in zat. Zat ja, want het is er allemaal vanaf. Het kost even wat moeite en uiteindelijk gewoon ouderwets grof geweld maar het resultaat mag er zijn. Ik moet helaas wel 1 muurtje gaan behangen want het beton is nogal, hoe zeg je dat, poreus <img src='http://barad-dur.nl/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   Goed, dat is het weer even. Wederom een flinke lap tekst. Nu maar eens denken over hoe ik m&#8217;n nieuwe bureau ga bouwen. Ajeto!</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/algemeen/bikkelen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

