March 2006 Entries

Alright, when's there going to be an TFS snap-in for MSH?

Sure I can use the .NET classes directly (and am), but I want a TFSC: provider! I want a TFWIT: provider! :)

posted Friday, March 31, 2006 2:22 PM | Comments | Filed Under [ Windows PowerShell Team System ]

I picked up The Build Master a couple weeks ago, but have just gotten around to reading it. I'm only up to chapter five, but it's already justified itself as a purchase. What I found most amazing so far is how the author paints an exact picture of what I just had to deal with here at Mimeo which is that most development houses think of builds and SCM as a secondary task that can be performed by developers when the time comes. Nuh-uh. Read the book and the author explains exactly why this isn't the case and why it's important to have at least one person in your organization fulfilling this role as his/her primary responsibility.

For example, I was spending about 30-40% of my time performing SCM tasks. I'm the Chief Software Architect of the company... that's an insane amount of time for me to be dedicating to SCM when I have so many other things to do. That doesn't even account for the 15-25% time that another developer was spending focusing on build script maintenance, the actual running/monitoring of the builds and all the paperwork that goes along with doing releases. That's time that resource could be producing more features or fixing bugs. Crazy.

Luckily, we hired a Release Manager recently and his job is now full time doing all that work. We're in the process of migrating our code base to 2005 and Team Foundation Source Control so his job should become easier from both the SCM and the build point of views, but it's still going to be a full time job. We still have a lot of trouble communicating build defects, what builds are where and what work items have been completed in a given build. Hopefull Team Build solves a lot of those problems, but there still needs to be someone on top of that stuff communicating status between teams and that's why I'm happy to have him on board.

Anyway, I highly recommend picking up the book because it's definitely worth the read and offers a lot of valuable information from someone who has done this work for a long time. Oh and if your management team doesn't see the value in paying someone to perform those tasks, send them a copy too and encourage force them to read it.

posted Friday, March 31, 2006 2:16 PM | Comments | Filed Under [ Personal ]

Here's a heads up for anyone else out there working with Team Test Projects:

If you use an App.config in a Team Test Project and you make changes to it and then try to run the test again from the Test View the project will not redeploy the .config file to the bin directory with the test assembly. You must explicitly rebuild the test project to cause this to happen.

I spent about five minutes scratching my head on this one, so hopefully this will spare at least one other person out there from wasting anymore than that on it. ;)

posted Friday, March 31, 2006 1:48 PM | Comments | Filed Under [ .NET Team System ]

We had to go from single server, on test hardware, in separated domain to dual servers, both new hardware in a new domain. We had to try twice as the first time our SharePoint and Report servers weren't connecting to their DBs correctly, but it's all working flawlessly now! The documentation was basically spot on, so I suggest reading every step twice before you perform it.

Now we have ~180 days to try and purchase Team Foundation Server and VSTS client flavors. That seems like it's going to be a lot tougher thing to accomplish than actually getting the stuff installed. :\

Oh and big shout out has to go to our MIS guy, Joe Karnes, for getting this up and running so quickly. ;)

posted Thursday, March 30, 2006 8:58 AM | Comments | Filed Under [ Personal Team System ]

Now that TFS has RTM'd, check here for documentation about migrating your test environments to a production environment. I've been eagerly awaiting this documentation so that we can finally get off our slow ass VM evaluation environment onto some brand spankin' new hardware purchased to run TFS and nothin' but TFS! ;)

I'll be sure to post our experience with this process once it's complete.

posted Wednesday, March 22, 2006 12:17 PM | Comments | Filed Under [ .NET Team System ]

As you can probably tell by my last post, I spent some time learning MSH (formerly Monad) this weekend and am super pysched to use it as part of my every day problem solving. I picked up the Monad book by O'Reilly and and it was a really great jump start on learning the basics. Most amazing however is, once you learn the basics, everything else really does just come together because of the consistency that is encouraged within the environment. The true power of the environment comes from it's ties to .NET of course since you can manipulate any .NET class and, by way of COM interop in the CLR, any COM object with the command line.

If you have some spare cycles to burn, I highly recommend checking it out, it can seriously change the way you think about accomplishing some every day development tasks, not to mention the power to automate those pesky, repetitive tasks.

posted Monday, March 20, 2006 6:20 PM | Comments | Filed Under [ .NET Windows PowerShell ]

For anyone who's familiar with WATIR, check out this simple MSH script I whipped up:

# Create an instance of IE
$ie = new-object -ComObject "InternetExplorer.Application"

# Navigate to MSN search
$ie.Navigate("http://search.msn.com")

# Make IE visible
$ie.Visible = $true

# Grab the DOM document instance
$document = $ie.Document

# !! See note at end of post !!

# Get the query text box and set the search term
$document.getElementById("q").innerText = "Drew Marsh"

# Click the search button
$document.getElementById("srch_btn").click()

Now granted this isn't doing the exact same thing as WATIR yet (i.e. it's not really emulating keystrokes to the text box), but basically all one needs to do is create a customized “snap-in” for MSH which would introduce a library of cmdlets that provide functionality analogous to the utility functions provided by WATIR's set of libraries and off you go.

Just to show off a little more power of how MSH could be leveraged to do browser app automation, imagine, as part of a test, you wanted to go to the main page of your blog, find the most recent post and click on the header to make sure it takes you to the posts stand alone page. Well, the structure of my weblog is such that all post headers are inside of <div> with the class “posthead”. Knowing this, we can now write the following script to find the first post's header link and click it:

# Create an instance of IE
$ie = new-object -ComObject "InternetExplorer.Application"

# Navigate to my weblog homepage
$ie.Navigate("http://blog.hackedbrain.com")

# Make the browser visible
$ie.Visible = $true

# Grab the DOM document instance
$document = $ie.Document

# !! See note at end of post !!

# Get all the DIVs, then reduce the set to only those
# that have a className of "posthead", then walk the DOM
# into the anchor element and click it
($document.getElementsByTagName("div") | where-object { $_.className -eq "posthead" })[0].firstChild.firstChild.click()

Now I will gladly concede that this example sucks compared to the WATIR equivalent you could whip up right now. However, as I mentioned earlier, we could quickly and easily extend MSH with a snap-in that introduces a set of cmdlets and which return extended types using adaptation that provide simple, rich document navigation and interaction. Just imagine writing this instead:

# Get an instance of IE the nice way
$ie = get-internetexplorer

# Hide all the threading junk behind a nice method
$ie.Open("http://blog.hackedbrain.com")

# Select elements out of the live DOM using XPath syntax
$postHeaderLink = $ie.Select("//div[@class=posthead][1]//a")

# Interact with the elements, can even add custom methods to DOM
# elements using adaptation
$postHeaderLink.Click()

So, the only remaining question is: who's going to step up to the plate and write this thing? :) I'm notoriously fickle when it comes to focusing on any one technology, so I'm not gonna volunteer. ;) You could probably make some nice cash off of donations or something if you took it far enough, yet kept it open source. However, I think I'm going to have someone on my team investigate this a little further and continue playing the architect role. I'll be sure to keep everyone up to date with any progress made.

Note: I left the following lines out of the above two code samples because it clouded the meaning, but basically IE loads documents asynchronusly and you're supposed to wait for the NavigateComplete event to fire before attempting to touch the document property, but you can also just sleep the main thread like so:

# Wait for IE to load the document
while($document -eq $null)
{
  [System.Threading.Thread]::Sleep(100)
  $document = $ie.Document
}

# Wait for the document to load completely
while($document.readyState -ne "complete")
{
  [System.Threading.Thread]::Sleep(100)
}
posted Monday, March 20, 2006 8:51 AM | Comments | Filed Under [ .NET Web Development Windows PowerShell ]

This month's Print Solutions Magazine is all about Web-to-Print and as part of their cover story they have an article that talks about Mimeo called Mimeo on the Move. Here's the lead in with a great quote from our CEO:

The industry’s fastest-growing company relies on speed, precision and web-to-print. Its aggressive CEO’s mission: Make “Mimeo” a verb.

posted Monday, March 20, 2006 8:40 AM | Comments | Filed Under [ Personal ]

Holy hell, has anyone else tried to purchase Team System or even get information about purchasing Team System from Microsoft? It's ridiculous. People don't even know about transitioning your MSDN Universal subscription. That's all I wanted to do to start is transition to MSDN + Team Suite (where ya pay a little more money, but save overall). Three diff. people I talked to didn't know what the hell I was talking about. We're in the Empower program, but even they couldn't help. You'd almost think they don't want us to be able to buy this stuff. :\

posted Monday, March 13, 2006 10:03 AM | Comments | Filed Under [ Personal Team System ]

So you need people to upload files to your web application, but you're a smart developer and you want to make sure you're not vulnerable to any kind of DoS. Luckily Microsoft has built a setting into the <httpRuntime> element of ASP.NET called maxRequestLength to govern the maximum size of an HTTP request. Great, problem solved! Well, here's the bad news: if someone does exceed that length you can't handle that error gracefully in any way shape or form.

The ASP.NET runtime will immediately reject the request based on the Content-Length HTTP header and will not execute any other part of the ASP.NET pipeline. This includes anything you've set for <customErrors>. The only thing I can think of to do is to customize the 500 status in IIS, but it kinda stinks that I have to resort to configuring IIS to work around this. :(

posted Monday, March 13, 2006 9:57 AM | Comments | Filed Under [ Web Development ]

So I've subscribed to MSN at a yearly rate of $90 or so for the past three years because I love all the diff. services, the web browser and rich client for Hotmail access, etc. Now I'm watching all these richer Windows Live services roll out and I'm wondering when/if this stuff gets rolled into MSN. Am I going to get a new browser, rich email client, etc. anytime soon or is the software I'm paying for going stale so that MS can give away richer web (AJAX if you must) clients for free?

posted Wednesday, March 01, 2006 12:26 PM | Comments | Filed Under [ Personal ]