<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">The Agileer</title><subtitle type="html">Doug Seelinger&amp;#39;s blog</subtitle><id>http://blogs.msdn.com/b/agileer/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/agileer/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2011-06-28T23:37:24Z</updated><entry><title>The CORRECT Way to Code a Custom Exception Class</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2013/05/17/the-right-way-to-write-a-custom-exception-class.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2013/05/17/the-right-way-to-write-a-custom-exception-class.aspx</id><published>2013-05-17T20:36:00Z</published><updated>2013-05-17T20:36:00Z</updated><content type="html">&lt;p&gt;There is a lot of advice out there on how to go about building your own custom exception classes.&amp;nbsp; A lot of these sources are at least partially correct. Some are totally wrong.&amp;nbsp; Some even advocate abandoning the base System.Exception class altogether, but that&amp;rsquo;s throwing the baby out with the bathwater, in my opinion.&amp;nbsp; None that I've seen show how to serialize/deserialize your custom exception class should it have additional data in it's subclass. It&amp;rsquo;s enough to make one despair of ever finding the &amp;ldquo;right&amp;rdquo; way to build an exception class.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A lot of the confusion around exceptions comes about if you&amp;rsquo;ve ever actually tried to serialize an exception using an Xml-based serializer.&amp;nbsp; You &lt;em&gt;are &lt;/em&gt;testing the code you write, correct? When attempting to serialized your nice new exception class with something like XmlSerializer, the serializer will simply choke, stating that it can&amp;rsquo;t serialize any class that has an IDictionary member.&amp;nbsp; And System.Exception has an IDictionary in it.&amp;nbsp; Yet every piece of literature coming out of Microsoft says that we should build custom exceptions (sub-typed from Exception, and not ApplicationException) and mark them as [Serializable].&amp;nbsp; What gives?&amp;nbsp; Well, there are more serializers in the world than just the XML-based serializers, and that&amp;rsquo;s when it&amp;rsquo;s important to serialize exceptions.&amp;nbsp; The System.Runtime.Serialization.Formatters.Binary.BinaryFormatter, for example,&amp;nbsp;serializes exceptions just fine.&lt;/p&gt;
&lt;p&gt;So, how do you derive from Exception correctly, particularly if you&amp;rsquo;ve got additional information in your custom exception class?&amp;nbsp; I thought you&amp;rsquo;d never ask.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    [Serializable]
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AuthorizationRequiredException : Exception
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ResourceReferenceProperty { get; set; }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; AuthorizationRequiredException()
        {
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; AuthorizationRequiredException(&lt;span class="kwrd"&gt;string&lt;/span&gt; message)
            : &lt;span class="kwrd"&gt;base&lt;/span&gt;(message)
        {
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; AuthorizationRequiredException(&lt;span class="kwrd"&gt;string&lt;/span&gt; message, Exception inner)
            : &lt;span class="kwrd"&gt;base&lt;/span&gt;(message, inner)
        {
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; AuthorizationRequiredException(SerializationInfo info, &lt;br /&gt;            StreamingContext context)
            : &lt;span class="kwrd"&gt;base&lt;/span&gt;(info, context)
        {
            ResourceReferenceProperty = info.GetString(&lt;span class="str"&gt;"ResourceReferenceProperty"&lt;/span&gt;);
        }

        [SecurityPermission(SecurityAction.Demand, SerializationFormatter = &lt;span class="kwrd"&gt;true&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; GetObjectData(SerializationInfo info, &lt;br /&gt;            StreamingContext context)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (info == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;"info"&lt;/span&gt;);
            info.AddValue(&lt;span class="str"&gt;"ResourceReferenceProperty"&lt;/span&gt;, ResourceReferenceProperty);
            &lt;span class="kwrd"&gt;base&lt;/span&gt;.GetObjectData(info, context);
        }

    }
&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&amp;nbsp;And here are the tests that drive it to completion (and drove me to the correct solution):&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;    [TestClass]
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AuthorizationRequiredExceptionTests
    {
        [TestMethod]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthorizationRequiredException_default_ctor()
        {
            Assert.IsNotNull(&lt;span class="kwrd"&gt;new&lt;/span&gt; AuthorizationRequiredException());
        }

        [TestMethod]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthorizationRequiredException_ctor_string()
        {
            Assert.IsNotNull(&lt;span class="kwrd"&gt;new&lt;/span&gt; AuthorizationRequiredException(&lt;span class="str"&gt;"message"&lt;/span&gt;));
        }

        [TestMethod]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthorizationRequiredException_ctor_string_ex()
        {
            var innerEx = &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;"foo"&lt;/span&gt;);

            Assert.IsNotNull(&lt;span class="kwrd"&gt;new&lt;/span&gt; AuthorizationRequiredException(&lt;span class="str"&gt;"message"&lt;/span&gt;, &lt;br /&gt;                innerEx));
        }

        [TestMethod]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthorizationRequiredException_serialization_test()
        {
            var ex1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; AuthorizationRequiredException(&lt;span class="str"&gt;"message"&lt;/span&gt;) &lt;br /&gt;                { ResourceReferenceProperty = &lt;span class="str"&gt;"MyReferenceProperty"&lt;/span&gt; };

            var buffer = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[4096];
            var ms = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(buffer);
            var ms2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(buffer);
            var formatter = &lt;span class="kwrd"&gt;new&lt;/span&gt; BinaryFormatter();

            formatter.Serialize(ms, ex1);

            var ex2 = (AuthorizationRequiredException)formatter.Deserialize(ms2);

            Assert.AreEqual(ex1.Message, ex2.Message);
            Assert.AreEqual(ex1.ResourceReferenceProperty, &lt;br /&gt;                ex2.ResourceReferenceProperty);
        }

        [TestMethod]
        [ExpectedException(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(ArgumentNullException))]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; GetObjectData_throws_when_info_null()
        {
            var sut = &lt;span class="kwrd"&gt;new&lt;/span&gt; AuthorizationRequiredException(&lt;span class="str"&gt;"message"&lt;/span&gt;) &lt;br /&gt;                { ResourceReferenceProperty = &lt;span class="str"&gt;"MyReferenceProperty"&lt;/span&gt; };

            &lt;span class="rem"&gt;// ReSharper disable AssignNullToNotNullAttribute&lt;/span&gt;
            sut.GetObjectData(&lt;span class="kwrd"&gt;null&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamingContext());
            &lt;span class="rem"&gt;// ReSharper restore AssignNullToNotNullAttribute&lt;/span&gt;
        }
    }
&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;If you use this code as a template for creating your custom exceptions, you won&amp;rsquo;t go too far wrong, I think.&lt;/p&gt;
&lt;p&gt;As far as XML-based serializers goes, I hope that the Base Class Library team will take some time and just fix the "chokes on IDictionary" issue.&amp;nbsp; Frankly, it's quite embarrassing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10419742" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="testability" scheme="http://blogs.msdn.com/b/agileer/archive/tags/testability/" /><category term=".NET Framework" scheme="http://blogs.msdn.com/b/agileer/archive/tags/-NET+Framework/" /></entry><entry><title>Starting Up with Windows Azure</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2012/08/30/starting-up-with-windows-azure.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2012/08/30/starting-up-with-windows-azure.aspx</id><published>2012-08-30T16:03:57Z</published><updated>2012-08-30T16:03:57Z</updated><content type="html">&lt;p&gt;I'm not new to Windows Azure, but I would definitely like to learn more.&amp;#160; Really, the landscape has changed a lot in the last year or so, making &amp;quot;knowing Azure&amp;quot; about as complex as &amp;quot;knowing Microsoft&amp;quot; was about 10-15 years ago. Let's start off with some definitions.&lt;/p&gt;  &lt;h1&gt;X as a Service&lt;/h1&gt;  &lt;p&gt;&amp;quot;Software as a Service&amp;quot; (SaaS), &amp;quot;Platform as a Service&amp;quot; (PaaS), &amp;quot;Infrastructure as a Service&amp;quot; (IaaS); the computing world is absolutely going the way of subscription &amp;quot;services&amp;quot; - the cloud.&amp;#160; So what does Windows Azure offer?&amp;#160; Well, if you count Office 365, all of them.&amp;#160; If not, then it offers both PaaS and IaaS, with IaaS receiving the most press, recently, as it fills a gap in more easily allowing &amp;quot;Private Cloud&amp;quot; users to migrate to the &amp;quot;Public Cloud&amp;quot; &lt;/p&gt;  &lt;h1&gt;How Do I Start?&lt;/h1&gt;  &lt;p&gt;Well, first you'll need a Windows Azure subscription.&amp;#160; At the time of this writing, you can get a free 90-day subscription at &lt;a href="http://www.windowsazure.com/"&gt;http://www.windowsazure.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Next, you'll need something to deploy software to Windows Azure with.&amp;#160; The easiest to get started with is Visual Studio 2012 at &lt;a title="Visual Studio 2012" href="http://www.microsoft.com/visualstudio/en-us"&gt;http://www.microsoft.com/visualstudio/en-us&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10345058" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How to Stop Mercurial from Complaining about SSL Cert Fingerprints</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2012/05/04/how-to-stop-mercurial-from-complaining-about-ssl-cert-fingerprints.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2012/05/04/how-to-stop-mercurial-from-complaining-about-ssl-cert-fingerprints.aspx</id><published>2012-05-04T14:00:54Z</published><updated>2012-05-04T14:00:54Z</updated><content type="html">&lt;p&gt;I know Mercurial is just trying to be friendly and warn me that it doesn’t know if certain SSL certs are valid or not (though I wish they’d just use the Windows cert repository when on the Microsoft platform), but the little nag warnings like…&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;“warning: hg.codeplex.com certificate with fingerprint 1c:ef:1d:4f:55:57:5b:8c:ab:78:a1:72:2c:d2:1b:56:fd:64:03:19 not verified (check hostfingerprints or web.cacerts config setting)”&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;…are a bit monotonous.&lt;/p&gt;  &lt;p&gt;And they’re probably supposed to be.&amp;#160; However, it is pretty simple to get rid of such warnings.&amp;#160; All you need to do is edit your mercurial.ini file.&amp;#160; On Windows 7, this can be found at C:\users\[your account]\mercurial.ini.&amp;#160; Or, if you’re using TortoiseHg, Open “Files | Settings” and click the “Edit File” button in the upper right corner.&amp;#160; Then you just add the following two lines to that file:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;[hostfingerprints]     &lt;br /&gt;hg.codeplex.com = 1c:ef:1d:4f:55:57:5b:8c:ab:78:a1:72:2c:d2:1b:56:fd:64:03:19&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Of course, this example assumes you’re referencing the CodePlex repository.&amp;#160; All the data you need to add to the mercurial.ini file can be found in the warning message you get (bitbucket, etc.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10300982" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="Source Control" scheme="http://blogs.msdn.com/b/agileer/archive/tags/Source+Control/" /></entry><entry><title>AutoFakes Is Now Live at CodePlex</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2012/03/21/autofakes-is-now-live-at-codeplex.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2012/03/21/autofakes-is-now-live-at-codeplex.aspx</id><published>2012-03-21T23:29:00Z</published><updated>2012-03-21T23:29:00Z</updated><content type="html">&lt;p&gt;After many years of just talk, I&amp;rsquo;ve finally released my first Open Source Software project at CodePlex, called &lt;a href="http://autofakes.codeplex.com/"&gt;AutoFakes&lt;/a&gt;.&amp;nbsp; It&amp;rsquo;s meant for Visual Studio 11, though I suppose it would probably work in VS 10 if you have Pex/Moles installed, but definitely haven&amp;rsquo;t tested THAT.&lt;/p&gt;
&lt;p&gt;Basically, it&amp;rsquo;s like an auto-mocking container (minus the container &amp;ndash; there is no dependence on any IoC container).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say you&amp;rsquo;re doing TDD and have a class that you&amp;rsquo;re building tests for.&amp;nbsp; Of course, that class is being modified over time &amp;ndash; maybe it receives new dependencies, it changes dependencies, or even has some dependencies refactored out.&amp;nbsp; I&amp;rsquo;ve been there and when this happens, I have to go through ALL my unit tests for the class and build new mocks for the dependencies and modify the code that instantiates your code under test.&amp;nbsp; Not fun when you have dozens of tests for a particular class (this assumes you&amp;rsquo;re not using a SetUp type method, which you can&amp;rsquo;t do anyway in the case of XUnit.net).&lt;/p&gt;
&lt;p&gt;What would be really cool is if there was a way to automatically construct the class you&amp;rsquo;re testing with all mock dependencies &amp;ndash; let the framework figure out what those dependencies are and just build the class itself without the manual work of figuring out dependencies and mocking each one.&amp;nbsp; Well, there actually are plenty of those out there already &amp;ndash; that is, for actual mocking frameworks like &lt;a href="http://ayende.com/blog/tags/rhino-mocks"&gt;RhinoMocks&lt;/a&gt;, &lt;a href="http://code.google.com/p/moq/"&gt;Moq&lt;/a&gt;, etc.&amp;nbsp; The problem is that Visual Studio 11 has a cool, new mocking and isolation framework called Fakes, and there's no existing "auto mocking" type behavior out in the Internets for this new framework, yet.&amp;nbsp; Peter Provost talks about a lot of the new VS11 unit testing features, including Fakes, &lt;a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx"&gt;here&lt;/a&gt;.&amp;nbsp; There is also pretty good documentation for Fakes (at least for beta software) &lt;a href="http://aka.ms/vs11-fakes"&gt;at MSDN&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Given that you understand what using the Fakes Framework is like, you could create a test method something like following example:&lt;/p&gt;
&lt;pre&gt;        [TestMethod]
        public void ConnectorManagerCanGetConnectors()
        {
            // Arrange
            // ConnectorManager has a dependency - IConnectorRepository
            var autofake = new AutoFake&amp;lt;ConnectorManager&amp;gt;();
            var stubConnector = new StubIConnector();
            autofake.Get&amp;lt;StubIConnectorRepository&amp;gt;().GetConnectorsString =
                filter =&amp;gt;
                {
                    return new List&amp;lt;IConnector&amp;gt; {stubConnector, stubConnector};
                };


            // Act
            IList&amp;lt;IConnector&amp;gt; result = autofake.Target.GetConnectors("filter");

            // Assert
            Assert.AreEqual(2, result.Count);
        }&lt;/pre&gt;
&lt;p&gt;Later, if my "ConnectorManager" gains or loses additional dependencies, I don't necessarily&amp;nbsp;have to come back to this test and modify it in any way - AutoFakes will detect the new dependency (an interface or abstract class, right now) and construct the class under test correctly.&lt;/p&gt;
&lt;p&gt;If you have suggestions for additions to the framework (AutoFakes, not the general Visual Studio Fakes Framework), go to the AutoFakes &lt;a href="http://autofakes.codeplex.com/discussions"&gt;Discussion&lt;/a&gt; or &lt;a href="http://autofakes.codeplex.com/workitem/list/basic"&gt;Issue Tracker&lt;/a&gt;, or just add a comment to this blog post.&amp;nbsp; I&amp;rsquo;ll make sure the request gets put into the appropriate area.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10286122" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="agility" scheme="http://blogs.msdn.com/b/agileer/archive/tags/agility/" /><category term="testability" scheme="http://blogs.msdn.com/b/agileer/archive/tags/testability/" /><category term="Visual Studio" scheme="http://blogs.msdn.com/b/agileer/archive/tags/Visual+Studio/" /><category term="Software Development" scheme="http://blogs.msdn.com/b/agileer/archive/tags/Software+Development/" /></entry><entry><title>Why Won’t My Custom Cmdlets Appear?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2012/02/21/why-won-t-my-custom-cmdlets-appear.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2012/02/21/why-won-t-my-custom-cmdlets-appear.aspx</id><published>2012-02-21T19:03:06Z</published><updated>2012-02-21T19:03:06Z</updated><content type="html">&lt;p&gt;Once again, I’ve been puzzled multiple times as to why my custom cmdlets sometimes don’t appear in PowerShell after I’ve added them via Add-PSSnapIn.&amp;#160; The last post didn’t stick with me, so a little more detail to drill it into my thick skull this time…&lt;/p&gt;  &lt;p&gt;As it turns out, &lt;strong&gt;Cmdlets must have a public default constructor, of course!&lt;/strong&gt;&amp;#160; I sometimes forget this step when I’m in my TDD rhythm.&amp;#160; So something like this:&lt;/p&gt;  &lt;div style="background-color: #515151; padding: 5px"&gt;   &lt;pre style="color: #dfdfbf"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: #efc986"&gt;using&lt;/span&gt; System.Management.Automation;

&lt;span style="color: #efc986"&gt;namespace&lt;/span&gt; MyCmdlets
{
    [&lt;span style="color: #8acccf"&gt;Cmdlet&lt;/span&gt;(&lt;span style="color: #8acccf"&gt;VerbsCommon&lt;/span&gt;.New, &lt;span style="color: #dfaf8f"&gt;&amp;quot;DooDad&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: #efc986"&gt;public class&lt;/span&gt;&lt;span style="color: #8acccf"&gt; NewDooDadCommand&lt;/span&gt; : My&lt;span style="color: #8acccf"&gt;BaseCommand&lt;/span&gt;
    {
        [&lt;span style="color: #8acccf"&gt;Parameter&lt;/span&gt;(Position = &lt;span style="color: #6e96be"&gt;0&lt;/span&gt;, Mandatory = &lt;span style="color: #efc986"&gt;true&lt;/span&gt;)]
        &lt;span style="color: #efc986"&gt;public string&lt;/span&gt; MyData { &lt;span style="color: #efc986"&gt;get&lt;/span&gt;; &lt;span style="color: #efc986"&gt;set&lt;/span&gt;; }

        &lt;span style="color: #efc986"&gt;private readonly&lt;/span&gt;&lt;span style="color: #8c8cb4"&gt; IDooDadFactory&lt;/span&gt; _dooDadFactory;&lt;/font&gt;&lt;/pre&gt;

  &lt;pre style="color: #dfdfbf"&gt;&lt;font face="Consolas"&gt;        &lt;span style="color: #efc986"&gt;public&lt;/span&gt; NewDooDadCommand(&lt;span style="color: #8c8cb4"&gt;IDooDadFactory&lt;/span&gt; dooDadFactory )
        {
            _dooDadFactory = dooDadFactory;
        }

        ...
    }
}&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Should really look more like this:&lt;/p&gt;

&lt;div style="background-color: #515151; padding: 5px"&gt;
  &lt;pre style="color: #dfdfbf"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: #efc986"&gt;using&lt;/span&gt; System.Management.Automation;

&lt;span style="color: #efc986"&gt;namespace&lt;/span&gt; MyCmdlets
{
    [&lt;span style="color: #8acccf"&gt;Cmdlet&lt;/span&gt;(&lt;span style="color: #8acccf"&gt;VerbsCommon&lt;/span&gt;.New, &lt;span style="color: #dfaf8f"&gt;&amp;quot;DooDad&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: #efc986"&gt;public class&lt;/span&gt;&lt;span style="color: #8acccf"&gt; NewDooDadCommand&lt;/span&gt; : My&lt;span style="color: #8acccf"&gt;BaseCommand&lt;/span&gt;
    {
        [&lt;span style="color: #8acccf"&gt;Parameter&lt;/span&gt;(Position = &lt;span style="color: #6e96be"&gt;0&lt;/span&gt;, Mandatory = &lt;span style="color: #efc986"&gt;true&lt;/span&gt;)]
        &lt;span style="color: #efc986"&gt;public string&lt;/span&gt; MyData { &lt;span style="color: #efc986"&gt;get&lt;/span&gt;; &lt;span style="color: #efc986"&gt;set&lt;/span&gt;; }

        &lt;span style="color: #efc986"&gt;private readonly&lt;/span&gt;&lt;span style="color: #8c8cb4"&gt; IDooDadFactory&lt;/span&gt; _dooDadFactory;&lt;/font&gt;&lt;/pre&gt;

  &lt;pre style="color: #dfdfbf"&gt;&lt;span style="color: #808080"&gt;        /// &amp;lt;summary&amp;gt;
        ///&lt;/span&gt;&lt;span style="color: #7a987a"&gt; Need this public default constructor&lt;/span&gt;&lt;span style="color: #808080"&gt;
        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style="color: #efc986"&gt;
        public&lt;/span&gt; NewDooDadCommand()
            :&lt;span style="color: #efc986"&gt;this&lt;/span&gt;(&lt;span style="color: #8acccf"&gt;ServiceLocator&lt;/span&gt;.GetInstance&amp;lt;&lt;span style="color: #8c8cb4"&gt;IDooDadFactory&lt;/span&gt;&amp;gt;())
        {}&lt;/pre&gt;

  &lt;pre style="color: #dfdfbf"&gt;&lt;font face="Consolas"&gt;        &lt;span style="color: #efc986"&gt;public&lt;/span&gt; NewDooDadCommand(&lt;span style="color: #8c8cb4"&gt;IDooDadFactory&lt;/span&gt; dooDadFactory )
        {
            _dooDadFactory = dooDadFactory;
        }

        ...
    }
}&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10270647" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="testability" scheme="http://blogs.msdn.com/b/agileer/archive/tags/testability/" /><category term="PowerShell" scheme="http://blogs.msdn.com/b/agileer/archive/tags/PowerShell/" /></entry><entry><title>When Your Custom Cmdlets Don’t Show Up After Loading with Add-PSSnapIn…</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2012/01/30/when-your-custom-cmdlets-don-t-show-up-after-loading-with-add-pssnapin.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2012/01/30/when-your-custom-cmdlets-don-t-show-up-after-loading-with-add-pssnapin.aspx</id><published>2012-01-30T22:57:38Z</published><updated>2012-01-30T22:57:38Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;… make sure that your Cmdlet’s class has a default constructor.&amp;#160; (Note to self: “Duh.”)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10261975" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>HTML 5 Printable Infographic</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2012/01/30/html-5-printable-infographic.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2012/01/30/html-5-printable-infographic.aspx</id><published>2012-01-30T16:05:03Z</published><updated>2012-01-30T16:05:03Z</updated><content type="html">&lt;p&gt;Amit @ &lt;a href="http://bloggerspath.com"&gt;http://bloggerspath.com&lt;/a&gt; released a really nice Infographic: &lt;a href="http://bloggerspath.com/ultimate-html5-cheat-sheet-for-web-developers/"&gt;An Ultimate HTML5 Cheat Sheet for Web Developers&lt;/a&gt;.&amp;#160; Very nice indeed.&amp;#160; But some of us Luddites still like to print things like these out and post them on the walls – a big pain when you have a long graphic image.&amp;#160; So I’ve broken up the graphic into several pages and put it in a PDF for your enjoyment.&amp;#160; All credit goes to Amit, of course.&amp;#160; A lot of work went into this on his part – my part in making it easily printable was only a few minutes worth of work.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://skydrive.live.com/redir.aspx?cid=321ebce6cefdcf6a&amp;amp;resid=321EBCE6CEFDCF6A!1284&amp;amp;parid=321EBCE6CEFDCF6A!175"&gt;Printable PDF&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The original infographic can be viewed on: &lt;a href="http://bloggerspath.com/ultimate-html5-cheat-sheet-for-web-developers/"&gt;An Ultimate HTML5 Cheat Sheet for Web Developers&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10261767" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="Web Development" scheme="http://blogs.msdn.com/b/agileer/archive/tags/Web+Development/" /></entry><entry><title>Connecting to Exchange 2010 from ILM</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2011/12/05/connecting-to-exchange-2010-from-ilm.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2011/12/05/connecting-to-exchange-2010-from-ilm.aspx</id><published>2011-12-05T12:32:54Z</published><updated>2011-12-05T12:32:54Z</updated><content type="html">&lt;p&gt;Besides the post from my good friend, Aung OO, on &lt;a href="http://technet.microsoft.com/en-us/magazine/ff472471.aspx"&gt;Exchange Provisioning using ILM 2007 and FIM 2010&lt;/a&gt;, one thing to keep in mind is that if you don't get the Exchange 2010 RPS URI correct, then you might get weird errors when exporting even though you don't expect to provision any mailboxes.&amp;nbsp; Twice now (thus the blog post) I've been hit by the following error, in two different environments:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;The WinRM client received an HTTP status code of 502 from the remote WS-Management service.&amp;nbsp; For more information, see the about_Remote_Troubleshooting Help topic.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In my case, I hadn't actually flubbed the Exchange 2010 RPS URI, it was logically correct, but in this particular environment it needed an FQDN, so instead of &lt;a href="http://exchsvr/powershell"&gt;http://exchsvr/powershell&lt;/a&gt; I needed &lt;a href="http://exchsvr.mycompany.com/powershell"&gt;http://exchsvr.mycompany.com/powershell&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244194" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="FIM" scheme="http://blogs.msdn.com/b/agileer/archive/tags/FIM/" /><category term="ILM &amp;quot;2&amp;quot;" scheme="http://blogs.msdn.com/b/agileer/archive/tags/ILM+_2600_quot_3B00_2_2600_quot_3B00_/" /></entry><entry><title>Right-Click and Dragging a .ZIP</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2011/08/06/right-click-and-dragging-a-zip.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2011/08/06/right-click-and-dragging-a-zip.aspx</id><published>2011-08-06T21:22:56Z</published><updated>2011-08-06T21:22:56Z</updated><content type="html">&lt;p&gt;Maybe this was obvious to everyone else, but I just realized that by right-clicking and dragging a .ZIP file, I can extract it to the folder that I’m dragging it onto.&amp;#160; Whoda thunk it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10193384" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Setting Up an NLB Cluster for a FIM Portal/Web Service</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/agileer/archive/2011/06/28/setting-up-an-nlb-cluster-for-a-fim-portal-web-service.aspx" /><id>http://blogs.msdn.com/b/agileer/archive/2011/06/28/setting-up-an-nlb-cluster-for-a-fim-portal-web-service.aspx</id><published>2011-06-29T03:37:24Z</published><updated>2011-06-29T03:37:24Z</updated><content type="html">&lt;p&gt;A lot of us old MIIS/ILM folks are heavy into development but a little light in the infrastructure department (like me).&amp;nbsp; So I was surprised to see that there weren't any great tutorials around on how to set up an NLB cluster for your FIM Service servers.&amp;nbsp; I'm running my whole FIM lab on my laptop (it's a pretty beefy laptop at 16GB) but I was stuck when it came to setting up an NLB on this Hyper-V laptop (Windows 2008 R2).&amp;nbsp; What follows is pieced together from various posts I found, as well as a good bit of trial and error.&amp;nbsp; This may not be the optimal setup for NLB (I'll leave that to the &lt;span style="text-decoration: underline;"&gt;master configurators&lt;/span&gt; - a term folks tell me I coined in the late 90s early 00s), but it should be good enough to get things going in a lab environment.&lt;/p&gt;
&lt;p&gt;I saw instances where each node had 1 NIC and each node had 2 (or more) NICs, but as 2 NICs seemed to be the most popular, the following assumes that there are 2 NICs in each cluster node.&lt;/p&gt;
&lt;p&gt;Oh, and one other thing that I noted was that if you are using Hyper-V on Windows 2008 R2 (and apparently only R2, though I haven't tested previous Hyper-Vs), for any network adapter used in the cluster make sure that you use &amp;ldquo;Legacy Network Adapters&amp;rdquo; (pretty non-intuitive, and probably a bug) and set the NICs to be used for the NLB cluster to &lt;b&gt;Enable spoofing of MAC addresses &lt;/b&gt;in the VM&amp;rsquo;s settings for that specific Network Adapter.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On each FIM Service server, add the &lt;b&gt;Network Load Balancing&lt;/b&gt; feature.&lt;/li&gt;
&lt;li&gt;On the first cluster node, run &lt;b&gt;nlbmgr.exe&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;On the &lt;b&gt;Cluster &lt;/b&gt;menu, select &lt;b&gt;New&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;b&gt;Host &lt;/b&gt;field, type the NetBIOS name of the first cluster node machine and click &lt;b&gt;Connect&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Confirm that:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Priority (unique host identifier)&lt;/b&gt; = &lt;b&gt;1&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;The correct &lt;b&gt;IP address&lt;/b&gt; is selected under &lt;b&gt;Dedicated IP addresses&lt;/b&gt; (should multiple NICs be present)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Default state: &lt;/b&gt;= &lt;b&gt;Started&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Click &lt;b&gt;Next&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Add&amp;hellip;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Confirm that &lt;b&gt;Add IPv4 address:&lt;/b&gt; is selected&lt;/li&gt;
&lt;li&gt;Enter the &lt;b&gt;IPv4 address:&lt;/b&gt; and &lt;b&gt;Subnet mask:&lt;/b&gt; for the cluster (the assigned virtual IP address).&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Next&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;b&gt;Full Internet name:&lt;/b&gt; as &lt;b&gt;idweb.mycompany.com&lt;/b&gt; (of course, substitute your organization&amp;rsquo;s info).&lt;/li&gt;
&lt;li&gt;Confirm that &lt;b&gt;Unicast&lt;/b&gt; is selected and click &lt;b&gt;Next&lt;/b&gt;. (I realize that Multicast is more common/desired, but I didn't want to have to make additional changes to accomodate that as well - it's my lab environment).&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Finish&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;After operation completes and you see &lt;b&gt;Update &lt;i&gt;N&lt;/i&gt; succeeded [double click for details&amp;hellip;] &lt;/b&gt;and the cluster&amp;rsquo;s &lt;b&gt;Status&lt;/b&gt; is &lt;b&gt;Converged&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Right-click the new cluster&amp;rsquo;s node and select &lt;b&gt;Add Host To Cluster&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;b&gt;Host&lt;/b&gt; type&lt;b&gt; &lt;/b&gt;the NetBIOS name of your second FIM Server, click &lt;b&gt;Connect&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate NIC and click &lt;b&gt;Next&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Next&lt;/b&gt; again.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;After the operation completes and you should see &lt;b&gt;Update &lt;i&gt;N&lt;/i&gt; succeeded [double click for details&amp;hellip;] &lt;/b&gt;and the cluster&amp;rsquo;s &lt;b&gt;Status&lt;/b&gt; is &lt;b&gt;Converged&lt;/b&gt; and that both interfaces &lt;b&gt;Initial Host State&lt;/b&gt; is &lt;b&gt;Started.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To test the new NLB cluster:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From one of the non-FIM Service machines, ping the virtual IP address.&lt;/li&gt;
&lt;li&gt;From one of the non-FIM Service machines, ping the first FIM Service Server via the non-clustered IP address (just to confirm that you can still access the machine via non-cluster IP)&lt;/li&gt;
&lt;li&gt;From one of the non-FIM Service machines, ping the second FIM Service server via the non-clustered IP address &amp;nbsp;(again, just to confirm that you can still access the machine via non-cluster IP)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10181198" width="1" height="1"&gt;</content><author><name>Doug Seelinger</name><uri>http://blogs.msdn.com/doseelin/ProfileUrlRedirect.ashx</uri></author><category term="FIM" scheme="http://blogs.msdn.com/b/agileer/archive/tags/FIM/" /></entry></feed>