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

<channel>
	<title>Dave Jansen's Blog</title>
	<atom:link href="http://dansen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dansen.wordpress.com</link>
	<description>Thoughts... Words... Stories... Experiences...</description>
	<lastBuildDate>Wed, 25 Jun 2008 23:32:53 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/e960aec7a4a664225f78efe5b222056e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Dave Jansen's Blog</title>
		<link>http://dansen.wordpress.com</link>
	</image>
			<item>
		<title>Code Camp 2008 &#8211; Wagga Wagga</title>
		<link>http://dansen.wordpress.com/2008/04/24/code-camp-2008-wagga-wagga/</link>
		<comments>http://dansen.wordpress.com/2008/04/24/code-camp-2008-wagga-wagga/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 09:49:15 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/24/code-camp-2008-wagga-wagga/</guid>
		<description><![CDATA[Tomorrow I&#8217;m heading to Wagga for Code Camp 2008 with Grant and Steve. Grant has been kind enough to drive us up and Emma, Grant&#8217;s wife, has baked Anzac cookies. 
Other friends heading up are Rory, John and Sean (where&#8217;s your blog???).
This will be my first time to Code Camp and the only other major [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=48&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Tomorrow I&#8217;m heading to Wagga for <a href="http://www.codecampoz.com/">Code Camp 2008</a> with <a href="http://ozgrant.com/2008/04/24/code-camp-oz-2008-wagga-wagga/">Grant</a> and <a href="http://seesharper.wordpress.com/">Steve</a>. Grant has been kind enough to drive us up and <a href="http://www.emholliday.com/blog/">Emma</a>, Grant&#8217;s wife, has baked <a href="http://www.taste.com.au/recipes/18509/chocolate+hazelnut+anzac+biscuits">Anzac cookies</a>. </p>
<p>Other friends heading up are <a href="http://neovolve.com/">Rory</a>, <a href="http://withpantscomesdignity.blogspot.com/">John</a> and Sean (where&#8217;s your blog???).</p>
<p>This will be my first time to Code Camp and the only other major conferences I have been to are Tech Ed and VSLive. I think its great that people are taking there own personal time and freely contributing to the community.</p>
<p>According to <a href="http://www.weather.com.au/nsw/wagga-wagga">Yahoo</a>, the weather forecast is looking fairly fine.</p>
<p><a href="http://dansen.files.wordpress.com/2008/04/image6.png"><img style="border-width:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/04/image-thumb6.png?w=470&#038;h=146" width="470" height="146"></a></p>
<p>I&#8217;ve borrowed my girlfriend&#8217;s <a href="http://www.apple.com/macosx/features/bootcamp.html">Apple MacBook Pro</a> and tonight I will have a crack at setting it up with Vista and Visual Studio 2008.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=48&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/24/code-camp-2008-wagga-wagga/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Error when Behaviour Extension types are not fully qualified</title>
		<link>http://dansen.wordpress.com/2008/04/23/exception-when-not-fully-qualifying-behaviour-extensions/</link>
		<comments>http://dansen.wordpress.com/2008/04/23/exception-when-not-fully-qualifying-behaviour-extensions/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 12:58:13 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/23/exception-when-not-fully-qualifying-behaviour-extensions/</guid>
		<description><![CDATA[Custom behaviour extensions are a great way to customise service behaviour such as implementing exception shielding as described here in Rory&#8217;s post&#160; or message validation using the Microsoft Enterprise Library Validation Application block.
I recently implemented a custom WCF behaviour extension for shielding exceptions when I came across the following cryptic exception.
&#8220;An error occurred during the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=45&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Custom behaviour extensions are a great way to customise service behaviour such as implementing exception shielding as described here in <a href="http://neovolve.com/archive/2008/04/07/implementing-ierrorhandler.aspx">Rory&#8217;s post</a>&nbsp; or message validation using the <a href="http://www.codeproject.com/KB/WCF/WCFVAB.asp">Microsoft Enterprise Library Validation Application block.</a></p>
<p>I recently implemented a custom WCF behaviour extension for shielding exceptions when I came across the following cryptic exception.</p>
<blockquote><p><font face="Arial" color="#ff0000">&#8220;An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.&#8221;</font></p>
</blockquote>
<p><a href="http://dansen.files.wordpress.com/2008/04/image5.png"><img style="border-width:0;" height="445" alt="image" src="http://dansen.files.wordpress.com/2008/04/image-thumb5.png?w=556&#038;h=445" width="556" border="0"></a></p>
<p>While the message was somewhat cryptic, it pointed me to the service behaviour were I realised I had specified the incorrect version on the type attribute.</p>
<h2>Steps</h2>
<p>1. Create new behaviour extension. My extension shielded and traced certain exceptions using the <a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.ierrorhandler.aspx">IErrorHandler</a>.<br />2. Use <a href="http://msdn2.microsoft.com/en-us/library/ms732009.aspx">SVC Configuration Editor</a> to plug the extension in. It added the following configuration as expected.</p>
<div style="font-size:10pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">system.serviceModel</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;</span><span style="color:#a31515;">extensions</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">behaviorExtensions</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">add</span><span style="color:blue;"> </span><span style="color:red;">name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">ErrorHandlerBehavior</span>&#8220;</p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Wcf.Demo.Service.ErrorHandlerElement, Wcf.Demo.Service, </span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</span>&#8220;<span style="color:blue;"> /&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;/</span><span style="color:#a31515;">behaviorExtensions</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;/</span><span style="color:#a31515;">extensions</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">system.serviceModel</span><span style="color:blue;">&gt;</span></p>
</div>
<p>3. Ran integration unit tests that passed.<br />4. The service build was integrated into TeamBuild which happen to automatically update my AssemblyInfo version files.<br />5. As soon as a TeamBuild kicked off and the assembly version changed, I received the cryptic error.<br />6. I realised I had an incorrect version configured in the web.config so I replaced the fully qualified type with:</p>
<div style="font-size:10pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">behaviorExtensions</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;</span><span style="color:#a31515;">add</span><span style="color:blue;"> </span><span style="color:red;">name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">ErrorHandlerBehavior</span>&#8220;</p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Wcf.Demo.Service.ErrorHandlerElement, Wcf.Demo.Service</span>&#8220;<span style="color:blue;"> /&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">behaviorExtensions</span><span style="color:blue;">&gt;</span></p>
</div>
<p><!--EndFragment-->7. Ran tests and failed.</p>
<p>After attempting to diagnose the issue using tools such as Fusion Log Viewer, I checked Google (which I should have done first) and came across several posts also identifying the issue &#8211; including a closed and unresolved issue on Microsoft Connect. This is the <a href="http://dansen.wordpress.com/2008/04/09/code-analysis-ca1304-must-call-faultreasonfaultreasonstring-cultureinfo/">second time</a> round I have been to Microsoft Connect regarding a bug and it does not look like they will resolve this anytime soon.</p>
<h2>A Way Forward</h2>
<p>At this stage since there is no fix, a tedious workaround will have to be to get TeamBuild to modify the web.config and update the version number of the behaviour extension when applying a new version &#8211; which in my case is for every CI build triggered by a code checkin.</p>
<h2>Links</h2>
<ul>
<li>Mitch Denny has a good blog post/rant on this <a href="http://notgartner.wordpress.com/2006/12/19/rant-an-error-occured-creating-the-configuration-section-handler-for-systemservicemodelbehaviors/">here</a>.
<li>Microsoft Connect <a href="https://connect.microsoft.com/wcf/feedback/ViewFeedback.aspx?FeedbackID=216431&amp;wa=wsignin1.0">issue was raised but it was interestingly closed.</a>
<li>Keyvan also reports the problem <a href="http://nayyeri.net/blog/configuration-error-for-custom-behavior-extensions-in-wcf/">here</a>. </li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=45&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/23/exception-when-not-fully-qualifying-behaviour-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Suppressing Code Analysis Rules</title>
		<link>http://dansen.wordpress.com/2008/04/15/suppressing-code-analysis-rules/</link>
		<comments>http://dansen.wordpress.com/2008/04/15/suppressing-code-analysis-rules/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 15:13:45 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/15/suppressing-code-analysis-rules/</guid>
		<description><![CDATA[I&#8217;ve been using Code Analysis (FxCop) for a few months now and every now and then I come across a CA rule that I my solution violates. In 99% of situations, I comply to all the CA rules. In a previous post, I could not satisfy the CA1304 rule. Spelling checks is also another area [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=41&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been using Code Analysis (FxCop) for a few months now and every now and then I come across a CA rule that I my solution violates. In 99% of situations, I comply to all the CA rules. In a previous <a href="http://dansen.wordpress.com/2008/04/09/code-analysis-ca1304-must-call-faultreasonfaultreasonstring-cultureinfo/">post</a>, I could not satisfy the CA1304 rule. Spelling checks is also another area where CA rules fail all the time.</p>
<p>The process that I use for checking in code to TFS ensures that Code Analysis is run before hand and that the project setting &#8220;Treat Warnings as Errors&#8221; is set to true. This means that the CA rules that I want to ignore fail my project build.</p>
<p>There are several ways to get around this:</p>
<p>1. Don&#8217;t use CA &#8211; <em>not an option for me.<br />
</em>2. Don&#8217;t treat warnings as errors &#8211; <em>not an option for me.<br />
</em>3. Apply a Suppression &#8220;In Source&#8221;- <em>an option.<br />
</em>4. Apply a Suppression in &#8220;Project Suppression File (GlobalSuppression.cs) &#8211; <em>an ideal option</em>.</p>
<p>The last two options are my choice. Suppressing a CA rule places an attribute in code that informs FxCop to ignore the rule and therefore not raise a Warning or an Error.</p>
<h3>Example Rule Failures</h3>
<p>The following CA rules came up as Warnings for my solution. Both Suppress options are available. CA1304 gives two suppression options where as CA2210 (strong name key required) only allows a Project suppression because it is applied only at the assembly level. For a full list of the CA rules shipped with each version of VS/FxCop see this <a href="http://blogs.msdn.com/fxcop/archive/2008/01/07/faq-which-rules-shipped-in-which-version.aspx">post</a>.</p>
<p><a href="http://dansen.files.wordpress.com/2008/04/image4.png"><img style="border-width:0;" src="http://dansen.files.wordpress.com/2008/04/image-thumb4.png?w=523&#038;h=399" border="0" alt="image" width="523" height="399" /></a></p>
<h3>In Source Suppression</h3>
<p>When available, a CA rule can suppressed in the source code where the rule failed. Use the <strong>SuppressMessageAttribute </strong>to disable the CA rule.</p>
<pre>[<span style="color:#2b91af;">SuppressMessage</span>(<span style="color:#a31515;">"Microsoft.Globalization"</span>, <span style="color:#a31515;">"CA1304:SpecifyCultureInfo"</span>,
MessageId = <span style="color:#a31515;">"System.ServiceModel.FaultReason.#ctor(System.String)"</span>)]
<span style="color:blue;">public void </span>ProvideFault(<span style="color:#2b91af;">Exception </span>error,
<span style="color:#2b91af;">MessageVersion </span>version,
<span style="color:blue;">ref </span><span style="color:#2b91af;">Message </span>fault)
{
<span style="color:green;">// Return a 'ServiceFault' Fault Contract
</span><span style="color:#2b91af;">ServiceFault </span>faultDetail = <span style="color:blue;">new </span><span style="color:#2b91af;">ServiceFault</span>(<span style="color:#a31515;">"An error occured"</span>);

<span style="color:green;">// Construct FaultException with Fault Contract and FaultReason
</span><span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt; faultException =
<span style="color:blue;">new </span><span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt;(faultDetail,
<span style="color:blue;">new </span><span style="color:#2b91af;">FaultReason</span>(<span style="color:#a31515;">"FaultReasonText"</span>));
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The benefit of applying the rule override in the source, is that code reviewers can easily see where the attribute has been placed. An additional file is is not required. The disadvantages is that you must apply the the attribute for every rule failure even if they are the same failures across multiple operations in the same code file and multiple code files. It also dirties the code with an messy attributes.</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h3>Project Suppressions</h3>
<p>When selecting the Project Supressions File option, the <strong>SuppressMessageAttribute</strong> is placed in the projects GlobalSuppressions.cs file &#8211; Visual Studio will create one automatically. The attribute has overrides which allows you to target the exact place of the rule failure such as a class, method, field, namespace etc.</p>
<p>In my example, I have suppressed botth CA2210 and CA1304 rules in the GlobalSuppressions.cs. Visual Studio generates the code.</p>
<pre><span style="color:green;">// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click
// "In Project Suppression File".
// You do not need to add suppressions to this file manually.

</span><span style="color:blue;">using </span>System.Diagnostics.CodeAnalysis;

[<span style="color:blue;">assembly</span>: <span style="color:#2b91af;">SuppressMessage</span>(
<span style="color:#a31515;">"Microsoft.Design"</span>,
<span style="color:#a31515;">"CA2210:AssembliesShouldHaveValidStrongNames"</span>)]

[<span style="color:blue;">assembly</span>:
<span style="color:#2b91af;">SuppressMessage</span>(
<span style="color:#a31515;">"Microsoft.Globalization"</span>, <span style="color:#a31515;">"CA1304:SpecifyCultureInfo"</span>,
MessageId = <span style="color:#a31515;">"System.ServiceModel.FaultReason.#ctor(System.String)"</span>,
Scope = <span style="color:#a31515;">"member"</span>,
Target = <span style="color:#a31515;">"Wcf.Demo.Service.ErrorHandler.#ProvideFault(System.Exception,System.ServiceModel.Channels.MessageVersion,System.ServiceModel.Channels.Message&amp;)"
</span>)]</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Notice the the CA1304 suppression contains Scope and Target properties. This can be changed so that the suppression is scoped to a wider code base such a a namespace.</p>
<p>The benefits of project suppressions is cleaner code, less duplication of the SuppressMessage attribute and easier to remove if failure is fixed. It&#8217;s also easier to code review as all failure overrides are in the one place. The only disadvantage that I can see is that there is an additional code file.</p>
<p>My preference is to always use project suppressions. In the near future , I will discuss some of the processes of how I use Code Analysis.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=41&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/15/suppressing-code-analysis-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging WCF Clients and Services</title>
		<link>http://dansen.wordpress.com/2008/04/15/debugging-wcf-clients-and-services/</link>
		<comments>http://dansen.wordpress.com/2008/04/15/debugging-wcf-clients-and-services/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 14:09:20 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/15/debugging-wcf-clients-and-services/</guid>
		<description><![CDATA[Debugging WCF services from the client through to the service is much easier when attaching the debugger to either the service or both the client and the service.
In the past, I have debugged services by firing up the client application and manually attaching to the WCF Service Host &#8211; which in this case is the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=38&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Debugging WCF services from the client through to the service is much easier when attaching the debugger to either the service or both the client and the service.</p>
<p>In the past, I have debugged services by firing up the client application and manually attaching to the WCF Service Host &#8211; which in this case is the ASP.NET worker process. This process is quite cumbersome.</p>
<p>Visual Studio has feature that supports attaching to multiple projects when starting up.&nbsp; </p>
<p>In this example, I have a WCF service hosted in IIS which lives in the Wcf.Demo.IisServiceHost project. I also have a Wcf.Demo.TestHarness project which calls the service. I want to be able to attach the debugger to both the client and service by simply pressing F5.</p>
<h3>Steps</h3>
<p>1. Right click on the solution and select &#8220;<em><strong>Set StartUp Projects&#8230;</strong></em>&#8220;.</p>
<p><a href="http://dansen.files.wordpress.com/2008/04/image.png"><img style="border-width:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/04/image-thumb.png?w=296&#038;h=176" width="296" height="176"></a></p>
<p>2. In the StartUp tab, select &#8220;<strong><em>Multiple startup projects</em></strong>&#8221; and select the projects you want to start up. </p>
<p>3. On the Action of the selected projects, select &#8220;Start&#8221; to start with the debugger attached. </p>
<p><a href="http://dansen.files.wordpress.com/2008/04/image1.png"><img style="border-width:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/04/image-thumb1.png?w=455&#038;h=313" width="455" height="313"></a></p>
<p>If you now run (F5) the application, it will fire up both the Test Harness and a Internet browser to the service virtual directory. You can disable this.</p>
<p>4. Go to the Web project properties for the WCF web project and select &#8220;<strong><em>Don&#8217;t open a page</em></strong>&#8220;.</p>
<p>&nbsp;<a href="http://dansen.files.wordpress.com/2008/04/image2.png"><img style="border-width:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/04/image-thumb2.png?w=556&#038;h=312" width="556" height="312"></a></p>
<p>Now when you hit F5, the test harness will launch and the debugger will be attached to both processes.</p>
<p><a href="http://dansen.files.wordpress.com/2008/04/image3.png"><img style="border-width:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/04/image-thumb3.png?w=695&#038;h=344" width="695" height="344"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=38&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/15/debugging-wcf-clients-and-services/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/image-thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Handling Fault Contracts</title>
		<link>http://dansen.wordpress.com/2008/04/15/handling-fault-contracts/</link>
		<comments>http://dansen.wordpress.com/2008/04/15/handling-fault-contracts/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 13:35:59 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/15/handling-fault-contracts/</guid>
		<description><![CDATA[Today I had an issue with catching Fault Contracts thrown from my WCF service. Every FaultException type raised by the service (excluding Communication Exceptions) were caught by the client as a FaultException instead of the expected FaultException&#60;T&#62;.
The issue was that I defined the FaultContractAttribute(type) on the operations in the Service Implementation class instead of on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=29&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I had an issue with catching Fault Contracts thrown from my WCF service. Every FaultException type raised by the service (excluding Communication Exceptions) were caught by the client as a <strong>FaultException</strong> instead of the expected <strong>FaultException&lt;T&gt;</strong>.</p>
<p>The issue was that I defined the <strong>FaultContractAttribute</strong>(type) on the operations in the Service Implementation class instead of on the Service Contract&#8217;s (Interface class) operations.</p>
<p>A service should always handle/shield exceptions and throw them as either a <strong>FaultException</strong> or a <strong>FaultException&lt;T&gt;</strong>. These types will not cause the channel to be faulted. I recommend defining Fault Contracts to convey information about the problem to client applications, and DO NOT provide the internal exception such as service stack traces. I&#8217;ll blog a post in the future on my recommendations service exception shielding patterns.</p>
<p>To catch Fault Contract types on the client, make sure that each Fault Contract type you require for that service operation, ensure that the FaultContractAttribute(Type) is specified.</p>
<h2>Service code</h2>
<h3>Error Handler </h3>
<p>The following code is implemented in the IErrorHandler class and is based on Rory&#8217;s post on <a href="http://neovolve.com/archive/2008/04/07/implementing-ierrorhandler.aspx">Implementing IErrorHandler</a> . In this example, all exceptions in my WCF service are changed to <strong>FaultException&lt;ServiceFault&gt;</strong>.</p>
<pre><span style="color:blue;">public void </span>ProvideFault(<span style="color:#2b91af;">Exception </span>error,
                         <span style="color:#2b91af;">MessageVersion </span>version,
                         <span style="color:blue;">ref </span><span style="color:#2b91af;">Message </span>fault)
{
    <span style="color:green;">// Return a 'ServiceFault' Fault Contract
    </span><span style="color:#2b91af;">ServiceFault </span>faultDetail = <span style="color:blue;">new </span><span style="color:#2b91af;">ServiceFault</span>(<span style="color:#a31515;">"An error occured"</span>);

    <span style="color:green;">// Construct FaultException with Fault Contract and FaultReason
    </span><span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt; faultException =
        <span style="color:blue;">new </span><span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt;(faultDetail,
        <span style="color:blue;">new </span><span style="color:#2b91af;">FaultReason</span>(<span style="color:#a31515;">"FaultReasonText"</span>));

    <span style="color:green;">// Construct MessageFault to return.
    </span><span style="color:#2b91af;">MessageFault </span>messageFault = faultException.CreateMessageFault();

    fault = <span style="color:#2b91af;">Message</span>.CreateMessage(version,
        messageFault,
        faultException.Action);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<h3>Service Contract</h3>
<p>Now this is where I went wrong. I did not decorate my service contract with the <strong>FaultContractAttribute</strong>. This attribute accepts a Type parameter which should be the type of the Fault Contract.</p>
<div style="font-size:10pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><span style="color:blue;">namespace</span> DJ.Wcf.Demo.ServiceContracts</p>
<p style="margin:0;">{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; [<span style="color:#2b91af;">ServiceContract</span>(Name = <span style="color:#a31515;">"DJ.Wcf.Demo.DemoService"</span>, Namespace = <span style="color:#a31515;">"DJ.Wcf.Demo"</span>)]</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">interface</span> <span style="color:#2b91af;">IDemoService</span></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color:#2b91af;">OperationContract</span>]</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>[<span style="color:#2b91af;">FaultContract</span>(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">ServiceFault</span>))]</strong></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">DemoData</span> GetDemoData(<span style="color:#2b91af;">Int32</span> demoId);</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0;">} </p>
</div>
<h2>Service Fault Contract code</h2>
<p>Here is a defined Fault Contract used by the service and client. Being a Data Contract, it could contain a collection of error messages e.g. a collection of validation error messages for a set of fields that were incorrectly set on the service operation.</p>
<pre><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>System.Runtime.Serialization;

<span style="color:blue;">namespace </span>Wcf.Demo.ServiceContracts
{
    [<span style="color:#2b91af;">DataContract</span>]
    <span style="color:blue;">public class </span><span style="color:#2b91af;">ServiceFault
    </span>{
        <span style="color:blue;">public </span>ServiceFault(<span style="color:#2b91af;">String </span>message)
        {
            Message = message;
        }

        [<span style="color:#2b91af;">DataMember</span>]
        <span style="color:blue;">public </span><span style="color:#2b91af;">String </span>Message
        {
            <span style="color:blue;">get</span>;
            <span style="color:blue;">set</span>;
        }
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h2>Client code</h2>
<p>The service calling code below shows several catch statements. When the service passes back a ServiceFault, it will be caught in: <font face="Courier New"><span style="color:blue;">catch</span> (<span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt;</font>. All other <strong>FaultException</strong> and <strong>FaultException&lt;T&gt;</strong> types will be handled by: <font face="Courier New"><span style="color:blue;">catch</span> (<span style="color:#2b91af;">FaultException</span> fault)</font> block.</p>
<p>Unhandled service exceptions will be raised and caught in:&nbsp; <font face="Courier New"><span style="color:blue;">catch</span> (<span style="color:#2b91af;">CommunicationException</span> cex)</font> which will cause the WCF channel to fault, thus forcing the client to create a new channel.</p>
<pre><span style="color:blue;">try
</span>{
    <span style="color:blue;">using </span>(<span style="color:#2b91af;">ChannelFactory</span>&lt;<span style="color:#2b91af;">IDemoService</span>&gt; channel =
        <span style="color:blue;">new </span><span style="color:#2b91af;">ChannelFactory</span>&lt;<span style="color:#2b91af;">IDemoService</span>&gt;(<span style="color:#a31515;">"DemoService"</span>))
    {
        <span style="color:#2b91af;">IDemoService </span>service = channel.CreateChannel();
        channel.Open();

        <span style="color:blue;">return </span>service.GetPerson(42);
    }
}
<span style="color:blue;">catch </span>(<span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt; serviceFault)
{
    <span style="color:#2b91af;">MessageBox</span>.Show(serviceFault.Message);
}
<span style="color:blue;">catch </span>(<span style="color:#2b91af;">FaultException </span>fault)
{
    <span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"Unknown Service Fault"</span>);
}
<span style="color:blue;">catch </span>(<span style="color:#2b91af;">TimeoutException </span>tex)
{
    <span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"Service call timed out. Please retry."</span>);
}
<span style="color:blue;">catch </span>(<span style="color:#2b91af;">CommunicationException </span>cex)
{
    <span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"Unknown Communications exception occured."</span>);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=29&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/15/handling-fault-contracts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>
	</item>
		<item>
		<title>Controlling the serialized order of WCF Data Contract Members</title>
		<link>http://dansen.wordpress.com/2008/04/12/controlling-the-serialized-order-of-wcf-data-contract-members/</link>
		<comments>http://dansen.wordpress.com/2008/04/12/controlling-the-serialized-order-of-wcf-data-contract-members/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 01:08:26 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/12/controlling-the-serialized-order-of-wcf-data-contract-members/</guid>
		<description><![CDATA[There are situations where you wish to specify the order of fields when they are serialized. I believe that a good designed service should not specify the ordering of fields nor should a service consuming application expect it..
In some applications, it is useful to know the order in which data from the various data members [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=25&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are situations where you wish to specify the order of fields when they are serialized. I believe that a good designed service should not specify the ordering of fields nor should a service consuming application expect it..</p>
<blockquote><p>In some applications, it is useful to know the order in which data from the various data members is sent or is expected to be received (such as the order in which data appears in the serialized XML). Sometimes it may be necessary to change this order&#8230;..</p>
</blockquote>
<p>Recently, I started using ReSharper (now I&#8217;m hooked). I used it to reformat my code based on a style which alphabetically reordered all the properties in the data contracts. The changes were checked in, unit tested, integrated united tested and deployed to Test. The changes I made broke the client application as the application was relying on the serialised Xml to be in a certain order. In my opinion this is definately <strong>not </strong>service design.</p>
<p>I was told about the <a href="http://msdn2.microsoft.com/en-us/library/ms729813.aspx">DataMemberAttribute.Order</a> property by <a href="http://neovolve.com/default.aspx">Rory</a> and reluctantly added the <a href="http://msdn2.microsoft.com/en-us/library/ms729813.aspx">Order</a> property to every data contract member. This change still broke the client application. The reason was that the client application was using the XmlSerializer which does not change its behvaior with the new <a href="http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.aspx">DataMember</a> attributes.</p>
<p>The solution was to serialise a Data Contract using the <a href="http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx">DataContractSerializer</a>. I still consider this to be a dirty solution because the ordering of the properties must always be the same, otherwise the consumer may break.</p>
<h3>Data Contract</h3>
<p>The following data contract lists fields in alphabetical order. The <a href="http://msdn2.microsoft.com/en-us/library/ms729813.aspx">Order</a> attribute forces the <a href="http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx">DataContractSerializer</a> to output elements in the requested order.</p>
<div style="font-size:10pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;">&nbsp;&nbsp;&nbsp; [<span style="color:#2b91af;">DataContract</span>]</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Person</span></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color:#2b91af;">DataMember</span>(Order = 2)]</strong></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:#2b91af;">Int32</span> Age { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</p>
<p style="margin:0;">&nbsp;</p>
<p><strong>
<p style="margin:0;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color:#2b91af;">DataMember</span>(Order = 0)]</strong></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:#2b91af;">String</span> FirstName { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color:#2b91af;">DataMember</span>(Order = 1)]</p>
<p></strong>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:#2b91af;">String</span> LastName { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0;">&nbsp;</p>
</div>
<h3>Serializing using the XmlSerializer</h3>
<div style="font-size:8pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">Person</span> person = <span style="color:blue;">new</span> <span style="color:#2b91af;">Person</span> { Age = 25, FirstName = <span style="color:#a31515;">&#8220;Bob&#8221;</span>, LastName = <span style="color:#a31515;">&#8220;Jane&#8221;</span> };</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; <span style="color:blue;">using</span> (<span style="color:#2b91af;">FileStream</span> writer = <span style="color:blue;">new</span> <span style="color:#2b91af;">FileStream</span>(<span style="color:#a31515;">&#8220;Person.xml&#8221;</span>, <span style="color:#2b91af;">FileMode</span>.Create))</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; {</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">XmlSerializer</span> xmlSerializer = <span style="color:blue;">new</span> <span style="color:#2b91af;">XmlSerializer</span>(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">Person</span>));</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlSerializer.Serialize(writer, person);</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.Close();</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; }</font></p>
</div>
<p>The XML is written in the order the fields are defined in the class.</p>
<div style="font-size:8pt;background:white;color:black;font-family:courier new;"><font size="2"><span style="color:blue;">
<div style="font-size:10pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;?</span><span style="color:#a31515;">xml</span><span style="color:blue;"> </span><span style="color:red;">version</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">1.0</span>&#8220;<span style="color:blue;">?&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;</span><span style="color:#a31515;">Person</span><span style="color:blue;"> </span><span style="color:red;">xmlns:xsi</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">http://www.w3.org/2001/XMLSchema-instance</span>&#8220;<span style="color:blue;"> </span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">xmlns:xsd</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">http://www.w3.org/2001/XMLSchema</span>&#8220;<span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">Age</span><span style="color:blue;">&gt;</span>25<span style="color:blue;">&lt;/</span><span style="color:#a31515;">Age</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">LastName</span><span style="color:blue;">&gt;</span>Jane<span style="color:blue;">&lt;/</span><span style="color:#a31515;">LastName</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">FirstName</span><span style="color:blue;">&gt;</span>Bob<span style="color:blue;">&lt;/</span><span style="color:#a31515;">FirstName</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;/</span><span style="color:#a31515;">Person</span><span style="color:blue;">&gt;</span></span></font>&nbsp;</p>
</div>
</div>
<h3><font size="2"><font size="2"><br />
<h3>Serializing using the DataContractSerializer</h3>
<div style="font-size:8pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">Person</span> person = <span style="color:blue;">new</span> <span style="color:#2b91af;">Person</span> { Age = 25, FirstName = <span style="color:#a31515;">&#8220;Bob&#8221;</span>, LastName = <span style="color:#a31515;">&#8220;Jane&#8221;</span> };</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; <span style="color:blue;">using</span> (<span style="color:#2b91af;">FileStream</span> writer = <span style="color:blue;">new</span> <span style="color:#2b91af;">FileStream</span>(<span style="color:#a31515;">&#8220;Person.xml&#8221;</span>, <span style="color:#2b91af;">FileMode</span>.Create))</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; {</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">DataContractSerializer</span> contractSerializer = <span style="color:blue;">new</span> <span style="color:#2b91af;">DataContractSerializer</span>(<span style="color:blue;">typeof</span> (<span style="color:#2b91af;">Person</span>));</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; contractSerializer.WriteObject(writer, person);</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.Close();</font></p>
<p style="margin:0;"><font size="2">&nbsp;&nbsp;&nbsp; }</font></p>
<p style="margin:0;"></font></font>&nbsp;</p>
</div>
</h3>
<h4>
<p><font size="2">The XML is written in the expected order defined by the Order property, even though the data contract defines in another order.</font></p>
</h4>
<div style="font-size:8pt;background:white;color:black;font-family:courier new;"><font size="2"><span style="color:blue;">
<div style="font-size:10pt;background:white;color:black;font-family:courier new;">
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;</span><span style="color:#a31515;">Person</span><span style="color:blue;"> </span><span style="color:red;">xmlns</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">http://schemas.datacontract.org/2004/07/Wcf.Demo.ServiceContracts</span>&#8220;<span style="color:blue;"> </span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">xmlns:i</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">http://www.w3.org/2001/XMLSchema-instance</span>&#8220;<span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">FirstName</span><span style="color:blue;">&gt;</span>Bob<span style="color:blue;">&lt;/</span><span style="color:#a31515;">FirstName</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">LastName</span><span style="color:blue;">&gt;</span>Jane<span style="color:blue;">&lt;/</span><span style="color:#a31515;">LastName</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; &lt;</span><span style="color:#a31515;">Age</span><span style="color:blue;">&gt;</span>25<span style="color:blue;">&lt;/</span><span style="color:#a31515;">Age</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&nbsp; &lt;/</span><span style="color:#a31515;">Person</span><span style="color:blue;">&gt;</span></span></font></p>
</div>
</div>
<p>&nbsp;</p>
<p>So if you require a specific order to be xml serialized, make sure you use the DataContractSerializer.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=25&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/12/controlling-the-serialized-order-of-wcf-data-contract-members/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>
	</item>
		<item>
		<title>CA1304 &#8211; Must specify CultureInfo when using FaultReason</title>
		<link>http://dansen.wordpress.com/2008/04/09/code-analysis-ca1304-must-specify-cultureinfo-when-using-faultreason/</link>
		<comments>http://dansen.wordpress.com/2008/04/09/code-analysis-ca1304-must-specify-cultureinfo-when-using-faultreason/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 12:36:31 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/04/09/code-analysis-ca1304-must-call-faultreasonfaultreasonstring-cultureinfo/</guid>
		<description><![CDATA[Today I came across the following issue when running Code Analysis over my WCF Error Shielding solution.

Because I have &#8220;Treat Warnings as Errors&#8221; enabled for all projects, Code Analysis fails.
Rory Primrose has recently blogged a very nice Error Handling solution which have implemented in a WCF service. As soon as I implemented the solution and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=24&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I came across the following issue when running Code Analysis over my WCF Error Shielding solution.</p>
<p><a href="http://dansen.files.wordpress.com/2008/04/caerror.jpg"><img style="border-width:0;" src="http://dansen.files.wordpress.com/2008/04/caerror-thumb.jpg?w=822&#038;h=100" border="0" alt="CAError" width="822" height="100" /></a></p>
<p>Because I have &#8220;Treat Warnings as Errors&#8221; enabled for all projects, Code Analysis fails.</p>
<p><a href="http://neovolve.com/archive/2008/04/07/implementing-ierrorhandler.aspx">Rory Primrose</a> has recently blogged a very nice <a href="http://neovolve.com/archive/2008/04/07/implementing-ierrorhandler.aspx">Error Handling</a> solution which have implemented in a WCF service. As soon as I implemented the solution and specified to return a custom Fault Contract, WCF returned an exception indicating that the &#8220;<a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.faultreason.aspx">FaultReason</a>&#8221; was not provided. So I constructed a new <a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.faultreason.aspx">FaultReason</a>, and passed it in to the FaultException(Fault, FaultReason).</p>
<blockquote><p>The <span class="selflink">FaultReason</span> class contains a set of <a id="ctl00_rs1_mainContentContainer_ctl22" href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.faultreasontext.aspx"><span style="color:#0066cc;">System.ServiceModel<span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span>FaultReasonText</span></a> objects, each of which contains a description of the fault in a specific language.</p></blockquote>
<p><strong>Sample</strong></p>
<p><!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red0\green128\blue0;\red163\green21\blue21;}??\fs20 \cf1 public\cf0  \cf1 void\cf0  ProvideFault(\cf4 Exception\cf0  error, \cf4 MessageVersion\cf0  version, \cf1 ref\cf0  \cf4 Message\cf0  fault)\par ??\{\par ??    \cf5 // Return a 'ServiceFault' Fault Contract\par ??\cf0     \cf4 ServiceFault\cf0  faultDetail = \cf1 new\cf0  \cf4 ServiceFault\cf0 (\cf6 "An error occured"\cf0 );\par ??\par ??    \cf5 // Construct FaultException with FaultContract and FaultReason\par ??\cf0     \cf4 FaultException\cf0 &amp;lt;\cf4 ServiceFault\cf0 &amp;gt; faultException = \par ??        \cf1 new\cf0  \cf4 FaultException\cf0 &amp;lt;\cf4 ServiceFault\cf0 &amp;gt;(faultDetail, \cf1 new\cf0  \cf4 FaultReason\cf0 (\cf6 "FaultReasonText"\cf0 ));\par ??\par ??    \cf4 MessageFault\cf0  messageFault = faultException.CreateMessageFault();\par ??\par ??    fault = \cf4 Message\cf0 .CreateMessage(version, messageFault, faultException.Action);\par ??\}} --></p>
<div style="background:white none repeat scroll 0;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;">public</span> <span style="color:blue;">void</span> ProvideFault(<span style="color:#2b91af;">Exception</span> error, <span style="color:#2b91af;">MessageVersion</span> version, <span style="color:blue;">ref</span> <span style="color:#2b91af;">Message</span> fault)</p>
<p style="margin:0;">{</p>
<p style="margin:0;"><span style="color:green;"> // Return a &#8216;ServiceFault&#8217; Fault Contract</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> ServiceFault</span> faultDetail = <span style="color:blue;">new</span> <span style="color:#2b91af;">ServiceFault</span>(<span style="color:#a31515;">&#8220;An error occured&#8221;</span>);</p>
<p style="margin:0;">
<p style="margin:0;"><span style="color:green;"><br />
// Construct FaultException with FaultContract and FaultReason</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt; faultException =</p>
<p style="margin:0;"><span style="color:blue;"> new</span> <span style="color:#2b91af;">FaultException</span>&lt;<span style="color:#2b91af;">ServiceFault</span>&gt;(faultDetail, <span style="color:blue;">new</span> <span style="color:#2b91af;">FaultReason</span>(<span style="color:#a31515;">&#8220;FaultReasonText&#8221;</span>));</p>
<p style="margin:0;">
<p style="margin:0;"><span style="color:#2b91af;"><br />
MessageFault</span> messageFault = faultException.CreateMessageFault();</p>
<p style="margin:0;">
<p>fault = <span style="color:#2b91af;">Message</span>.CreateMessage(version, messageFault, faultException.Action);</p>
<p style="margin:0;">}</p>
</div>
<p><!--EndFragment--></p>
<p>I compiled the code in Debug which was successful. I then switched on Code Analysis and it raised CA1304 : Microsoft.Globalization. The Code Analysis rule made sense to ensure I was using CultureInfo for the reason text.</p>
<p>However, the FaultReason does not provide any <strong>&#8216;public</strong>&#8216; constructor overrides to accept the CultureInfo. It does however provide an internal FaultReason(string text, CultureInfo cultureInfo) constructor.</p>
<p><a href="http://dansen.files.wordpress.com/2008/04/faultreason.jpg"><img style="border-width:0;" src="http://dansen.files.wordpress.com/2008/04/faultreason-thumb.jpg?w=678&#038;h=307" border="0" alt="FaultReason" width="678" height="307" /></a></p>
<p>After the help of <a href="http://neovolve.com/default.aspx">Rory</a> who confirmed with <a href="http://blogs.msdn.com/fxcop/">David Kean</a> from the <a href="http://blogs.msdn.com/fxcop/">Code Analysis Team</a> that this was a bug, I submitted feedback to <span style="font-size:11pt;font-family:'Calibri','sans-serif';color:#1f497d;"><a href="http://connect.microsoft.com/VisualStudio"><span style="color:#0000ff;">Microsoft Connect</span></a>.</span></p>
<p>You can keep track of this bug here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=337431&amp;wa=wsignin1.0</p>
<p>In the meantime, I have suppressed this CA rule in my GlobalSupressions.cs for the project.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=24&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/04/09/code-analysis-ca1304-must-specify-cultureinfo-when-using-faultreason/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/caerror-thumb.jpg" medium="image">
			<media:title type="html">CAError</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/04/faultreason-thumb.jpg" medium="image">
			<media:title type="html">FaultReason</media:title>
		</media:content>
	</item>
		<item>
		<title>Internode Naked ASDL2+ Plans</title>
		<link>http://dansen.wordpress.com/2008/03/15/internode-naked-asdl2-plans/</link>
		<comments>http://dansen.wordpress.com/2008/03/15/internode-naked-asdl2-plans/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 03:22:37 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/03/15/internode-naked-asdl2-plans/</guid>
		<description><![CDATA[News Link: http://www.internode.on.net/news/2008/03/78.php
Internode have beaten TPG to the market with ADSL/ADSL2+ broadband plans that do not require a third party line rental account such as Telstra. On average, Internode state that there is about a $20 saving per month.
Through a network agreement with Optus Wholesale, Internode will offer Naked ADSL2+ from $59.95 a month including [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=19&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>News Link: <a href="http://www.internode.on.net/news/2008/03/78.php">http://www.internode.on.net/news/2008/03/78.php</a></p>
<p><a href="http://www.internode.on.net/residential/internet/naked/">Internode</a> have beaten <a href="http://dansen.wordpress.com/2007/08/02/goodbye-line-rental-hello-tpg-uul-plans/">TPG</a> to the market with ADSL/ADSL2+ broadband plans that do not require a third party line rental account such as Telstra. On average, Internode state that there is about a $20 saving per month.</p>
<blockquote><p>Through a network agreement with Optus Wholesale, Internode will offer Naked ADSL2+ from $59.95 a month including a NodePhone1* telephone service. Since customers can save money by no longer paying for a third party phone line rental fee (typically $30 per month), this prices the Naked ADSL2+ service at a nett cost of as little as $29.95 per month &#8211; or less, if low cost call charges are included.</p>
</blockquote>
<p>There is an setup cost of $149 and then you can say goodbye to your analogue line. But if you require fax or back-to-base security monitoring, then you will still need a standard phone line connection.</p>
<p>There are cheaper options such as going with TPG value plans and a budget Telstra line connection, however Internode are known to provide one of the highest quality broadband services in Australia.</p>
<p>Supported Exchanges: <a title="https://secure.internode.on.net/webtools/dsl-coverage-table?carrier=Optus" href="https://secure.internode.on.net/webtools/dsl-coverage-table?carrier=Optus">https://secure.internode.on.net/webtools/dsl-coverage-table?carrier=Optus</a></p>
<p><a href="http://dansen.files.wordpress.com/2008/03/image1.png"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/03/image-thumb1.png?w=666&#038;h=352" width="666" height="352"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=19&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/03/15/internode-naked-asdl2-plans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/03/image-thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Google releases &quot;official&quot; Outlook Sync</title>
		<link>http://dansen.wordpress.com/2008/03/10/google-releases-official-outlook-sync/</link>
		<comments>http://dansen.wordpress.com/2008/03/10/google-releases-official-outlook-sync/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 04:40:20 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2008/03/10/google-releases-official-outlook-sync/</guid>
		<description><![CDATA[I have been using Google Calendar for some time now as I can:

Access it on any PC
See multiple calendars at a time (colour coded)
Share Calendars
Send out invites
Receive notifications on events via SMS and/or Email.

I still prefer to use Microsoft Outlook 2007 and have wanted to sync my Outlook and Google calendars together. I have used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=16&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have been using Google Calendar for some time now as I can:</p>
<ul>
<li>Access it on any PC
<li>See multiple calendars at a time (colour coded)
<li>Share Calendars
<li>Send out invites
<li>Receive notifications on events via SMS and/or Email.</li>
</ul>
<p>I still prefer to use Microsoft Outlook 2007 and have wanted to sync my Outlook and Google calendars together. I have used several custom sync tools that have been slow and buggy.</p>
<p>Google have now officially released a <a href="http://www.google.com/support/calendar/bin/answer.py?answer=89955">sync tool</a>. <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile.png' alt=':)' class='wp-smiley' /> </p>
<p>You can download the FREE software from <a href="http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe">here</a>.</p>
<p><a href="http://dansen.files.wordpress.com/2008/03/image.png"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" border="0" alt="image" src="http://dansen.files.wordpress.com/2008/03/image-thumb.png?w=384&#038;h=410" width="384" height="410"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=16&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2008/03/10/google-releases-official-outlook-sync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>

		<media:content url="http://dansen.files.wordpress.com/2008/03/image-thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Outlook Links &amp; Firefox</title>
		<link>http://dansen.wordpress.com/2007/11/12/outlook-links-firefox/</link>
		<comments>http://dansen.wordpress.com/2007/11/12/outlook-links-firefox/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 11:15:34 +0000</pubDate>
		<dc:creator>dansen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dansen.wordpress.com/2007/11/12/outlook-links-firefox/</guid>
		<description><![CDATA[For the past few months after upgrading to a newer version of FireFox 2.x, every time I click on a link in Outlook I get an error box. I was also having the same problem at work with a Windows XP Pro / Outlook 2003 setup. I finally decided to look into it and fix [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=13&subd=dansen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For the past few months after upgrading to a newer version of FireFox 2.x, every time I click on a link in Outlook I get an error box. I was also having the same problem at work with a Windows XP Pro / Outlook 2003 setup. I finally decided to look into it and fix the problem.</p>
<p>It was harder to fix the problem in Vista than in Windows XP.</p>
<h3>Vista</h3>
<p>In Vista, they have removed (or hidden) where you customise File Type extensions so you must create a registry file or use RegEdit to add a key.</p>
<ol>
<li>Using notepad create a reg file (ending in .reg)
<li>Paste the following into the file:</p>
<p><font face="Cordia New" size="4">Windows Registry Editor Version 5.00</p>
<p>[HKEY_CLASSES_ROOT\FirefoxURL\shell\open\ddeexec]<br />@=&#8221;"</font> </p>
<li>Run the reg file and restart Outlook.</li>
</ol>
<h3>Windows XP</h3>
<p>Windows XP allows you to customise the File Type extensions from Explorer.</p>
<ol>
<li>Open Windows Explorer (Not IE)
<li>Click on Tools | Options | FileTypes
<li>Find the extensions that are marked (NONE) and start with URL: HyperText
<li>Click Advanced
<li>Edit the Open action and clear out text in the DDE Message field.
<li>Apply changes.</li>
</ol>
<p>Thanks to <a href="http://www.deanlisenby.com/2007/10/outlookfirefox-issue.html" target="_blank">Dean Lisenby</a> and <a href="http://dosboy.ca/2007/08/firefox-outlook-and-vista-oh-my.html">Dosboy&#8217;s Bits and Bytes</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dansen.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dansen.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dansen.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dansen.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dansen.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dansen.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dansen.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dansen.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dansen.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dansen.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dansen.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dansen.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dansen.wordpress.com&blog=1210400&post=13&subd=dansen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dansen.wordpress.com/2007/11/12/outlook-links-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2613ce2237e8235db55cafe47bd9ce1?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Dave</media:title>
		</media:content>
	</item>
	</channel>
</rss>