<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Arogl Darthu's Blog</title>
    <link>http://blog.arogldarthu.nl/</link>
    <description>profound astoundment</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.4 - http://www.s9y.org/</generator>
    <pubDate>Fri, 06 Apr 2012 07:59:57 GMT</pubDate>

    <image>
        <url>http://blog.arogldarthu.nl/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Arogl Darthu's Blog - profound astoundment</title>
        <link>http://blog.arogldarthu.nl/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Truncating text while respecting word boundaries.</title>
    <link>http://blog.arogldarthu.nl/archives/16-Truncating-text-while-respecting-word-boundaries..html</link>
            <category>C#</category>
    
    <comments>http://blog.arogldarthu.nl/archives/16-Truncating-text-while-respecting-word-boundaries..html#comments</comments>
    <wfw:comment>http://blog.arogldarthu.nl/wfwcomment.php?cid=16</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.arogldarthu.nl/rss.php?version=2.0&amp;type=comments&amp;cid=16</wfw:commentRss>
    

    <author>nospam@example.com (Twan Jacobs)</author>
    <content:encoded>
    Every so once in a while the issue rises where you need to truncate a piece of text to a certain maximum length.&lt;br /&gt;
Now that in itself is not so hard to do. But the result can look quite strange when the truncation point happens in the middle of a word.&lt;br /&gt;
As always &lt;a href=&quot;http://stackoverflow.com/questions/3504937/building-a-smart-string-trimming-function-in-c-sharp&quot; title=&quot;Splitting up a string&quot;&gt;StackOverflow&lt;/a&gt; provides a good starting point.&lt;br /&gt;
I just thought using a &lt;a href=&quot;http://www.regular-expressions.info/&quot; title=&quot;Your online guide to...&quot;&gt;Regular Expression&lt;/a&gt; would be more concise. So here is my solution:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharp geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt; Ellipsis &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;...&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;// Match word boundaries at the end of a word.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;static&lt;/span&gt; Regex wordRegex &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=new+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;new&lt;/span&gt;&lt;/a&gt; Regex&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;@&amp;quot;(?&amp;lt;=\w)(?!\w)&amp;quot;&lt;/span&gt;, RegexOptions.&lt;span style=&quot;color: #0000FF;&quot;&gt;Compiled&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt; Truncate&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt; source, &lt;span style=&quot;color: #FF0000;&quot;&gt;int&lt;/span&gt; length&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;int&lt;/span&gt; maxLength &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; length &lt;span style=&quot;color: #008000;&quot;&gt;-&lt;/span&gt; Ellipsis.&lt;span style=&quot;color: #0000FF;&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;source &lt;span style=&quot;color: #008000;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; source.&lt;span style=&quot;color: #0000FF;&quot;&gt;Length&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;&amp;gt;&lt;/span&gt; length&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;int&lt;/span&gt; afterLastWordIndex &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Match m &lt;span style=&quot;color: #0600FF;&quot;&gt;in&lt;/span&gt; wordRegex.&lt;span style=&quot;color: #0000FF;&quot;&gt;Matches&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;source&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;m.&lt;span style=&quot;color: #0000FF;&quot;&gt;Index&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;=&lt;/span&gt; maxLength&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; afterLastWordIndex &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; m.&lt;span style=&quot;color: #0000FF;&quot;&gt;Index&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; break&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;String&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Concat&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;source.&lt;span style=&quot;color: #0000FF;&quot;&gt;Substring&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;, afterLastWordIndex&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;, Ellipsis&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;return&lt;/span&gt; source&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; Main&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#93;&lt;/span&gt; args&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt; source &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; &amp;#160; &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;The quick brown fox jumps over the lazy dog&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;WriteLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 1 &amp;#160; &amp;#160; &amp;#160; &amp;#160; 2 &amp;#160; &amp;#160; &amp;#160; &amp;#160; 3 &amp;#160; &amp;#160; &amp;#160; &amp;#160; 4 &amp;#160; &amp;#160; &amp;#160; &amp;#160; 5&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;WriteLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;12345678901234567890123456789012345678901234567890&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;WriteLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;source&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#93;&lt;/span&gt; truncingLengths &lt;span style=&quot;color: #008000;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;1&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;3&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;4&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;8&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;9&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;10&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;15&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;19&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;20&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;21&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;22&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;23&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;28&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;30&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;33&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;42&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;43&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0600FF;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;int&lt;/span&gt; truncAt &lt;span style=&quot;color: #0600FF;&quot;&gt;in&lt;/span&gt; truncingLengths&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;WriteLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;{0}: &lt;span style=&quot;color: #008080; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;{1}&lt;span style=&quot;color: #008080; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;&amp;quot;&lt;/span&gt;, truncAt, Truncate&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;source, truncAt&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;ReadLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 06 Apr 2012 07:12:08 +0000</pubDate>
    <guid isPermaLink="false">http://blog.arogldarthu.nl/archives/16-guid.html</guid>
    
</item>
<item>
    <title>MSBuild Exec task - IgnoreStandardErrorWarningFormat</title>
    <link>http://blog.arogldarthu.nl/archives/15-MSBuild-Exec-task-IgnoreStandardErrorWarningFormat.html</link>
            <category>WTF</category>
    
    <comments>http://blog.arogldarthu.nl/archives/15-MSBuild-Exec-task-IgnoreStandardErrorWarningFormat.html#comments</comments>
    <wfw:comment>http://blog.arogldarthu.nl/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.arogldarthu.nl/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>nospam@example.com (Twan Jacobs)</author>
    <content:encoded>
    If you are using MSBuild 4.0.30319 and try to set the property &lt;strong&gt;IgnoreStandardErrorWarningFormat&lt;/strong&gt; on the Exec task you might run into the following message error:&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;&lt;font color=&quot;maroon&quot;&gt;error MSB4064: The &quot;IgnoreStandardErrorWarningFormat&quot; parameter is not supported by the &quot;Exec&quot; task.&lt;/font&gt;&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;
The solution is very, very simple: be sure to add &lt;strong&gt;ToolsVersion=&quot;4.0&quot;&lt;/strong&gt; to the Project tag.&lt;br /&gt;
&lt;div class=&quot;xml geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;Project&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;DefaultTargets&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Bla&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ToolsVersion&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;4.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;Target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Bla&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;Exec&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;IgnoreStandardErrorWarningFormat&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Command&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;dir /w&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/Target&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/Project&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 01 Jun 2011 12:27:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.arogldarthu.nl/archives/15-guid.html</guid>
    
</item>
<item>
    <title>Upgrade test project from VS2005 to VS2010</title>
    <link>http://blog.arogldarthu.nl/archives/14-Upgrade-test-project-from-VS2005-to-VS2010.html</link>
            <category>WTF</category>
    
    <comments>http://blog.arogldarthu.nl/archives/14-Upgrade-test-project-from-VS2005-to-VS2010.html#comments</comments>
    <wfw:comment>http://blog.arogldarthu.nl/wfwcomment.php?cid=14</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.arogldarthu.nl/rss.php?version=2.0&amp;type=comments&amp;cid=14</wfw:commentRss>
    

    <author>nospam@example.com (Twan Jacobs)</author>
    <content:encoded>
    The solution contains several projects, including test projects. All of which now target .Net Framework 2.0 (although some already reference .Net Framework 3.0 or 3.5 assemblies). We do not want to upgrade to .Net Framework 4.0 just yet. Goal of the upgrade is to have every project in the solution target .Net Framework 3.5.&lt;br /&gt;
&lt;br /&gt;
After converting the solution to VS2010 most of the projects reference .Net Framework 2.0. Some of which do not build, because of references to assemblies targeted at a higher .Net Framework. Visual Studio 2010 does not allow cross-referencing to higher .Net Framework assemblies. Fixing this problem is quite simple: just re-target the project to .Net Framework 3.5.&lt;br /&gt;
&lt;br /&gt;
All of the test projects have been set to .Net Framework 4.0. One could discuss if this is acceptable for test projects as these will not be released. But for now it was decided to keep every project targeted at .Net Framework 3.5. Fortunately most of the test projects were easily re-targeted to .Net Framework 3.5. Hint: if you run into problems here, make sure VS2010 SP1Rel is installed.&lt;br /&gt;
&lt;br /&gt;
For one of the test projects the solution just would not load it if re-targeted at .Net Framework 3.5. Each time the project was re-targeted, the conversion wizard would just pop up and set it back to .Net Framework 4.0. Eventually we found a workaround by editing the project file by hand after the conversion.&lt;br /&gt;
&lt;br /&gt;
Two manual fixes were needed:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Change reference of &lt;strong&gt;&quot;Microsoft.QualityTools.UnitTestFramework&quot;&lt;/strong&gt; to &lt;br /&gt;&lt;code&gt;&amp;lt;Reference Include=&quot;Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL&quot; /&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Remove contents of the tag &lt;code&gt;&amp;lt;FileUpgradeFlags&amp;gt;0&amp;lt;/FileUpgradeFlags&amp;gt;&lt;/code&gt;, which hints VS2010 to start the conversion wizard.&lt;/li&gt;
&lt;/ul&gt; 
    </content:encoded>

    <pubDate>Mon, 09 May 2011 13:06:49 +0000</pubDate>
    <guid isPermaLink="false">http://blog.arogldarthu.nl/archives/14-guid.html</guid>
    
</item>
<item>
    <title>T-SQL: Import csv in temp table</title>
    <link>http://blog.arogldarthu.nl/archives/13-T-SQL-Import-csv-in-temp-table.html</link>
            <category>SQL</category>
    
    <comments>http://blog.arogldarthu.nl/archives/13-T-SQL-Import-csv-in-temp-table.html#comments</comments>
    <wfw:comment>http://blog.arogldarthu.nl/wfwcomment.php?cid=13</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.arogldarthu.nl/rss.php?version=2.0&amp;type=comments&amp;cid=13</wfw:commentRss>
    

    <author>nospam@example.com (Twan Jacobs)</author>
    <content:encoded>
    Seems pretty simple to do... Just execute a query like this one:&lt;br /&gt;
&lt;div style=&quot;font-family: Courier New&quot;&gt;&lt;div class=&quot;tsql geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;INTO&lt;/span&gt; #TESTCSV&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;OPENROWSET&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;&#039;Microsoft.Jet.OLEDB.4.0&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;&#039;Text;Database=C:&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\;&lt;/span&gt;HDR=YES&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #FF0000;&quot;&gt;&#039;SELECT * FROM test.csv&#039;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/div&gt;In my case I was getting the following error message, which got me baffled for quite some time:&lt;br /&gt;
&lt;div style=&quot;font-family: Courier New; color: red&quot;&gt;Msg 492, Level 16, State 1, Line 1&lt;br /&gt;
Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name &quot;test#csv.NoName&quot; is a duplicate.&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
This really didn&#039;t make any sense to me. There were no duplicate column names in the csv file and surely there were no columns named &#039;NoName&#039;, nor did I forget to name a column...&lt;br /&gt;
&lt;br /&gt;
Then it came to me: what if &lt;strong&gt;UNICODE&lt;/strong&gt; isn&#039;t parsed correctly? Maybe that could cause empty columns headers? The file was exported by ReportViewer and I had not looked at the encoding of the resulting csv file. Guess what!? The encoding was UNICODE. So, after saving the file in &lt;strong&gt;ANSI&lt;/strong&gt; encoding, the query executed like a charm. 
    </content:encoded>

    <pubDate>Wed, 13 Apr 2011 09:55:34 +0000</pubDate>
    <guid isPermaLink="false">http://blog.arogldarthu.nl/archives/13-guid.html</guid>
    
</item>
<item>
    <title>Wcf Exception Shielding - Unexpected FaultContracts</title>
    <link>http://blog.arogldarthu.nl/archives/12-Wcf-Exception-Shielding-Unexpected-FaultContracts.html</link>
            <category>WCF</category>
    
    <comments>http://blog.arogldarthu.nl/archives/12-Wcf-Exception-Shielding-Unexpected-FaultContracts.html#comments</comments>
    <wfw:comment>http://blog.arogldarthu.nl/wfwcomment.php?cid=12</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.arogldarthu.nl/rss.php?version=2.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    

    <author>nospam@example.com (Twan Jacobs)</author>
    <content:encoded>
    So you&#039;ve got Wcf Exception Shielding in place. All is well and the Enterprise Library Exception Handling Application Block takes care of those nasty exception details that you don&#039;t want your site visitors to know about... But have you ever had the urge to do more than just property mapping between exceptions and FaultContract? I know I have &lt;img src=&quot;http://blog.arogldarthu.nl/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
There is a way to do this and it is actually quite simple to realize. You just have to create your own custom IExceptionHandler. But let&#039;s start with a bit of configuration. By default you would have an Exception Policy named &quot;WCF Exception Shielding&quot;. Like so:&lt;br /&gt;
&lt;div class=&quot;xml geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;exceptionHandling&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;exceptionPolicies&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;add&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;WCF Exception Shielding&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/exceptionPolicies&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/exceptionHandling&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
This policy handles specific Exception types and for each of those it will pass the exception through a chain of IExceptionHandlers. The last of these would normally be Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.FaultContractExceptionHandler. For instance:&lt;br /&gt;
&lt;div class=&quot;xml geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;exceptionTypes&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;add&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;System.DivideByZeroException, mscorlib&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;postHandlingAction&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;ThrowNewException&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;DivideByZeroException&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;exceptionHandlers&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;add&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;exceptionMessage&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Dividing by zero is not allowed.&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000066;&quot;&gt;faultContractType&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;DivideByZeroFault, MyDll&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;FaultContractExceptionHandler, ExceptionHandling.WCF&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Fault Contract Exception Handler&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;mappings&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;add&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;source&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Guid&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Id&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;add&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;source&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Message&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Message&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/mappings&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/add&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/exceptionHandlers&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/add&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/exceptionTypes&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
Now what if your FaultContract would need additional data, that you can&#039;t just map from the Exception properties? For example:&lt;br /&gt;
- you might need the Message property of the InnerException;&lt;br /&gt;
- you need data that was logged to a database when the original exception got thrown.&lt;br /&gt;
&lt;br /&gt;
To make this possible, just create your own IExceptionHandler that will be used instead of the provided FaultContractExceptionHandler. There are two things to keep in mind when you do this. First of all you should always set the &lt;strong&gt;postHandlingAction&lt;/strong&gt; to &lt;strong&gt;ThrowNewException&lt;/strong&gt;. Second, you should let your IExceptionHandler return a specific Exception type: &lt;strong&gt;FaultContractWrapperException&lt;/strong&gt;. &lt;br /&gt;&lt;a href=&quot;http://blog.arogldarthu.nl/archives/12-Wcf-Exception-Shielding-Unexpected-FaultContracts.html#extended&quot;&gt;Continue reading &quot;Wcf Exception Shielding - Unexpected FaultContracts&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 27 Mar 2009 15:21:54 +0000</pubDate>
    <guid isPermaLink="false">http://blog.arogldarthu.nl/archives/12-guid.html</guid>
    
</item>

</channel>
</rss>
