Monday, May 31, 2004

Enterprise Services and app.config

Armand du Plessis shows how to use an app.config with Enterprise Services.

[Listening to: Rusty - California]

Sunday, May 30, 2004

Saturday, May 29, 2004

Visual Studio 2005 Brief emulation sucks

I got all excited when I saw the Visual Studio 2005 Community Technology Preview May 2004 had Brief emulation. Unfortunately it sucks. First Alt- keystrokes don't work -- they still access the menu items. Also, the Line selection ended up being a normal selection. Ah well.

[Listening to: Eric Cartman - Come Sail Away]

Slight change of direction

I'm putting what little I've done aside and starting fresh. I'm doing this for a couple of reasons:

  • Some/most of the current code was actually copied from my previous attempt. So it's a bit of a cheat.
  • I want to try some of the new code generation/code quality tools in the new Tech Preview
  • I have my solution broken out into several assemblies (Core.Messaging, Core.Configuration, Utility.Logging, Utility.UnitHelpers and Utility.Xml.) What's happening is that I'm pre-supposing where classes belong. Also, since I have a Unit test assembly for each real assembly I have quite a few to deal with. This makes loading and compiling the solution all that much longer.
  • I should be breaking code up along Code Access Security boundaries, not perceived usage boundaries.
  • I don't have that much code yet, so no is as good as it's going to get if I'm ever going to do it.

  • Wish me luck

    [Listening to: Sir Mix-A-Lot - Baby Got Back]

    Update: added point for Code Access Security

    Friday, May 28, 2004

    Installing Visual Studio 2005 Community Technology Preview May 2004 + MbUnit

    Just installed Visual Studio 2005 Community Technology Preview May 2004. Boy that takes a long time. Uninstalling the Tech Preview from March (after recommendations from numerous blogs) and the installing the new one blew away a good 4-5 hours. Running all of this under a Virtual PC certainly can't help either.

    One reminder: if you're using MbUnit (or pretty much any other tool that looks at assemblies) don't forget to add the following to the section of their app.config:
      <supportedRuntime version="v2.0.40426" />

    Runs like a charm now.

    [Update: Forgot to convert < and > into &lt; and &gt;. D'Oh]

    High-performance multithreading is very hard

    From Raymond Chen's absolute must-read blog - The Old New Thing we have: High-performance multithreading is very hard. Very useful links in this puppy.

    [Listening to: Styx - Renegade [I really must swap discs -- I already have this song "blogged"]]

    Making Strings more Secure in Whidbey

    Shawn Farkas gives an overview of the new SecureString class which goes a long way to Make Strings more Secure. (via Dana Epp.)

    [Listening to: Soundgarden - Pretty Noose]

    Wednesday, May 26, 2004

    Path.Combine

    An extremely useful (albeit old) tidbit from Craig Andera on Path.Combine.

    [Listening to: KoRn - Ass Itch]

    Mvp.Xml - XML cool utilities

    From Daniel Cazzulino, Mvp.Xml: XML cool utilities

    Looks like some useful tools but once again I'm unsure of the licensing. It uses both the Common Public License and a "Other/Proprietary License". Haven't downloaded yet to see what that means.

    Can anyone out there dumb these licenses down for the likes of me?

    [Listening to: Sarah MacLachlan & Delerium - Silence]

    WSE 2.0 Tracing Utility

    From the Daily Grind, Mike Taulty's WSE 2.0 Tracing Utility.

    I'd be a fool to not realize that I'll need web services somewhere. I'd be a bigger fool to think I'd get them right the first time and not need a tracing utility. Know what you are I always say.

    [Listening to: KoRn - Counting]

    Tuesday, May 25, 2004

    XPathReader

    Found this useful nugget from Oleg Tkachenko: Signs on the Sand: On XPathReader. Lot's of other useful nuggets too.

    By way of Daniel Cazzulino here.

    [Listening to: Beatles - Something]

    Threat Modeling Tool now available

    Lifted from Michael Howard's must-read blog:

    Threat Modeling Tool now available.


    Finally, it has been posted - Frank Swiderski's Threat modeling tool is now available for free download on MSDN. From the blurb:

    The Threat Modeling Tool allows users to create threat model documents for applications. It organizes relevant data points, such as entry points, assets, trust levels, data flow diagrams, threats, threat trees, and vulnerabilities into an easy-to-use tree-based view. The tool saves the document as XML, and will export to HTML and MHT using the included XSLTs, or a custom transform supplied by the user.


    Read Michael's article original here.

    [Listening to: Beastie Boys - Fight for your Right]

    Web Services Developer Center Home: Programming with Web Services Enhancements 2.0 (Web Services Enhancements (WSE) Technical Articles)

    Courtesy of the Daily Grind: a couple of useful articles on Web Services 2.0

  • Web Services Enhancements 2.0
  • Programming with Web Services Enhancements 2.0

  • [Listening to: Faith No More - Gentle Art of Making Enemies]

    Eric's list of the Best C# Bloggers

    Eric Gunnerson has compiled a list of the Best C# Bloggers. Who knows, maybe next year...

    [Listening to: Iron Maiden - Mother Russia]

    Copy Constructors vs ICloneable

    Shawn A Van Ness revisits his previous assumptions of Copy Constructors vs ICloneable. Courtesy of Paul Bartlett.

    [Listening to: Black Sabbath - Children of the Grave]

    Enterprise Service Application reconfiguration

    Not exactly sure if I'm going to need this but it kind of "smells" like it might. So, here it is
    Enterprise Service Application reconfiguration from Ingo Rammer.

    [Listening to: Sarah McLachlan - Unchained Melody]

    Thursday, May 20, 2004

    FREE XDN Professional for .NET Bloggers

    Mike Schinkel, president of Xtras.Net is generously offering a
    FREE XDN Professional Membership for anyone who blogs frequently about .NET throughout the month of May 2004. If you are a .NET blogger, see Mike's post for how to get your free XDN membership.

    First saw this in the Daily Grind from Mike Gunderloy.

    Wednesday, May 19, 2004

    Enterprise Instrumentation Framework (EIF) vs log4net

    Daniel Cazzulino compares the Enterprise Instrumentation Framework and log4net here.

    I've tried EIF both personnally at work and I have to agree: it's too heavy for me. Who knows, maybe I'll change my mind but for right now: I like the simplicity of log4net.

    I have a question (before I start using it): Can anyone boil down the Apache licence v 2.0 to plain english. This is the part that has always made be paranoid with open source licenses: I'm never 100% sure of whether or not, but using an OS tool/library/whatever, I would need to make my source available.

    This particular license seems quite open, but, if I use log4net in my app, does that make my app a "Derivative work"? I'm thinking not because in section 1 in the definition of "Derivative Works" (emphasis is my own):

    For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.

    Am I just being paranoid? Advice is welcome.

    [Listening to: Marilyn Manson - Irresposible Hate Anthem (Live)]

    Using the XSLT Transform with XML Signatures

    Shawn Farkas posts on
    Using the XSLT Transform with XML Signatures. Not sure I really get when I will need to use it, but I sense that I will. Posted here for posterity.

    [Listening to: Eminem - Kids]

    Making Class Library Project your default

    Many thanks to Daniel Cazzulino for finding a way to
    Make Class Library Project your default. (By way of Armand du Plessis.)

    Tuesday, May 18, 2004

    NTime - Performance unit testing tool

    Everyone needs a good profiler. I'll check this out (when I actually have something to profile.)

    NTime - Performance unit testing tool (Courtesy of the PowerToys WebLog)

    [Listening to: Daniela Mercury - Rosa Negra]

    Managed DPAPI Part I: ProtectedData

    Shawn Farkas shows how to use the new Managed DPAPI in

  • Part I: ProtectedData
  • Part II: ProtectedMemory.

  • I figure if I'm going to button down the configuration of this system I'll need something like this.

    [Listening to: Styx - Renegade]

    Assembly.LoadFrom + FileNotFoundException

    Jonathan gives us a solution to an
    Assembly Loading puzzle. I will eventually need to load my own assemblies, so any hints, workarounds, fixes, best practices: straight to the blog.

    Update: He's posted a follow up here

    Monday, May 17, 2004

    IT Security at Microsoft Overview

    Michael Howard points to an overview of IT Security at Microsoft. If you care about security (rhetorical question) you should be reading his blog.

    Friday, May 14, 2004

    App.config Examples

    Suzanne Cook gives some useful examples of App.config.

    She doesn't post often, but when she does it's a keeper.

    [Listening to: Tripping Daisy - Rise]

    Thursday, May 13, 2004

    Like the new skin?

    Couldn't help myself. Blogger.com has added a ton of new features.

    [Listening to: Adema - Freaking Out]

    Moving from NUnit to MbUnit -- here goes nothing

    With some encouragement from my first ever Blog Comment (thank you Jonathan) I'm trying to convert from NUnit to MbUnit. I figure I'd document as I go.

    Having dropped the latest version of MbUnit onto my VPC I figure I'd load some existing assemblies to see what happens when using the MbUnit GUI against an NUnit assembly.

    First, add an assembly. Hang on... no menus. I had a brain-blip. For a second or two (I hope it was only that long) I couldn't figure out just what to do. Thankfully my well trained right-mouse-button-index-finger jumped in and pulled me out of my haze. Of course, the context menu. Where was I again? [Is it time for my pudding?]

    Oh, yes, adding assemblies. Adding my previously compiled assembly gave me a security exception. I guess this isn't too much of a surprise as I'm developing as a non-admin. In particular it was a security error from Microsoft.ApplicationBlocks.ExceptionManagement trying to access the registry. Cool thing is, this error "went away." Okay so I cheated. I ran the app as an admin, then I ran as my user again.

    Running a second time I get a different error (progress, no?) It's a System.BadImageFormatException. I know this one. Since I'm running the .NET 1.1 binary on a Whidbey/CTP2005/.NET 2.0 machine it tips over. I can deal with that. Just as the following line to the MbUnit.GUI.exe.config
            <supportedRuntime version="v2.0.40301" />

    Okay, third times a charm right. Not quite. The app runs. Adding assemblies appears to be working but nothing happens. Running tests does nothing. Removing assemblies does nothing.

    Let's try recompiling with MbUnit...

    First removing all references to NUnit.Framework; easy enough.
    Add references to MbUnit.Framework.dll. You'll need MbUnit.Core.dll too.
    Replace using NUnit.Framework; with using MbUnit.Framework; (for TestFixtureAttrbite a.k.a [TestFixture]) AND using MbUnit.Core.Framework; (for TestAttribute a.k.a [Test])

    This probably would've been all that's required except that I have some custom NUnit type assert code for things that NUnit missed like AreEqual methods for System.Xml and System.Xml.XPath. So for that there were a bunch of code changes required. I can't help but notice the MbUnit.Core.Framework.Xml namespace. Perchange my custom stuff can go by-by?

    BTW: If you aren't using Lutz Roeders amazing .NET Reflector why don't you? Developing in .NET with it is like a kybrd wtht vwls.

    So far, so good. I have an assembly.

    WooHoo. I'm able to run the tests. A few aren't working, but hey, I changed some code and replace the whole unit testing framework. 2 failures out of 64 tests isn't too bad (I'll look at those later.)

    There's a few hiccups with the GUI (loading multiple assemblies caused some grief) but it mostly worked. And the HTML report is sweeet. Once I get the kinks ironed out I'll post again.

    That's all for now. Got to get some sleep for my day job. Sigh.

    [Listening to: Rob Zombie - Return of the Phantom Stranger]

    Composite Unit Testing with MbUnit

    Jonathan de Halleux uses MBUnit for Composite Unit Testing. I so have to try this.

    I originally saw this in a CodeProject article. It seemed almost useful then (no offence Jonathan) but it didn't click until now. I'll let you know how it goes.

    Beware File.OpenWrite

    I can just see me falling for this. CraigBlog - Beware File.OpenWrite. Courtesy of Craig Andera

    Exclusive read access to MSMQs

    Jeff Key gives tips on
    exclusive read access to an MSMQ queue. This might be useful.

    Wednesday, May 12, 2004

    New version of SnippetCompiler

    Via the Larkware Daily Grind there is a new version of Jeff Key's awesome SnippetCompiler App