Feeling the Bounce (RC7 Bug)
Note: This bug only effects people who downloaded TestDriven.NET RC7 on 05 Nov and are seeing "System.IO.FileNotFoundException: File or assembly name '...', or one of its dependencies, was not found."
I was a little over zealous chasing a rare bug earlier on today. The bug only shows itself if you change the output directory of a compact framework project. The problem originates from compact framework projects returning null instead of a configuration object. As a workaround I make an educated guess as to where the build output will be. I assume it will be '$(ProjectPath)\out\$(ConfigurationName)\'. Unfortunately this doesn't work if a non-default output directory is being used.
Ian Fraser noticed this issue earlier on today. I explained the situaction and updated the FaqList. I thought I'd have one more go at finding a better workaround. I knew it was possible to get the paths of various output group items (things like SourceFiles, ContentFiles, Built and Symbols). The idea was to look for any 'Built' DLL or EXE files and use this as the target assembly.
I did a new build, ran my unit tests, installed the new version and ran a few manual tests. Everything seemed to be working. I then uploaded it to the server as a new build. I should have left it at that, but stupidly I decided to make it RC7. In the past I've always dogfooded new builds for a while before making them release candidates. Some of my unit tests do execute inside an instance of Visual Studio, but these tend to use single project solutions. Only tests run on a multi-project solution would have shown up this bug.
This is the worst bug I have let out for a long time. You can tell if you've been bitten by executing the following ad-hoc test. Just right click inside the 'check' method and 'Run Test(s)'.
using System.Diagnostics;
class AdHoc
{
void check()
{
string codeBase = GetType().Assembly.CodeBase;
bool isBuggy = codeBase.IndexOf("/obj/") != -1;
Debug.WriteLine(isBuggy ? "You've Been Bitten" : "You're Safe");
}
}
If you have ended up with a buggy version, you can pick up a fix from the AutomatedBuilds page. I'll make sure this doesn't happen again.