• .net TDD Kata

    This is an oldy but a goody.

    http://rickardnilsson.net/post/2009/10/27/Code-Kata-Cast.aspx

    The lean and agile community puts much emphasis on the big picture or 'full team productivity' AND this is good AND part of that big picture productivity is really good tools and practices for developers (and when i say developers i mean people who turn problems into solutions with working software)

    A kata to me in my western interpretation is to put into muscle memory or innate response the ability to recognize the need for and implement a pattern.

    Besides this example of TDD what type of kata could you practice 'offline' and bring back to your job so that you don't use your bad habits as responses to situations?

     

    for example, what could we use as a kata for the scrum meeting? for breaking up legacy code and making it testable?

    post, email me, or hit me up @jpeckham on twitter.

     

    thanks,

     

    Full story

    Comments (0)

  • System.NullReferenceException at System.Web.UI.Control.ResolveAdapter()

    converting a project and it's unit tests from .net 1.1 to .net 3.5 and i ran into this error in our unit test suite.

     

    System.NullReferenceException : Object reference not set to an instance of an object.

    at System.Web.UI.Control.ResolveAdapter()
    at System.Web.UI.Control.EnsureChildControls()
    at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)

     

     It was really strange because when i ran just the 1 suite i did not get the error but when i ran the whole project set of suites i got the error. I immediately suspected threading but wasn't sure what to do. Thanks to intellisense and poking around i found the answer.

    Just put this attribute right on the unit test (or suite) that you want to adhere to STA (single threaded apartment).

     

    [

    RequiresThread(ApartmentState.STA)]

     

    Full story

    Comments (1)

  • 'system.serviceModel/commonBehaviors' configuration section cannot be created

    What i love about upgrades, installs, etc... is i flex parts of my troubleshooting skills that i've long since forgotten. Credit for this idea really goes to the engineers at a major financial solutions vendor... but hey i did the foot work and felt the pain.

    New-Object : Exception calling ".ctor" with "2" argument(s): "The 'system.serviceModel/commonBehaviors' configuration section cannot be created. The machine.config file is missing information. Verify that this configuration section is properly registered and that you have correctly spelled the section name. For Windows Communication Foundation sections, run ServiceModelReg.exe -i to fix this error."

    At C:\program files\my powershellscript.ps1+ $client = new-object <<<<  MyNamespace.MyServiceClient($binding,$endpoint)

        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException

        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

     

     

     basic solution: remove the web server role. re-install the web server role and all features you just uninstalled inadvertantly as dependants.

    but when i went to go look at  the machine.config to see what it put in there... this is what i found:

    <system.serviceModel>

    .... etc etc..

    <commonBehaviors>

        <endpointBehaviors>

            <Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>

        </endpointBehaviors>

        <serviceBehaviors>

            <Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>

        </serviceBehaviors>

    </commonBehaviors>

     

    </system.serviceModel>

    Full story

    Comments (0)