April 2005 - Posts

'Test With... Debugger' - Fixed!

It has been a frustrating few days getting 'Test With... Debugger' working again when any of the Beta2 products are installed (VS2005 or Express).  It turns out there are two completely independent issues.  One breaks debugging in VS2003 when installed side-by-side with VS2005.  The other appears to be an issue with the VS2005 debugger itself (it crashes when it can't find one of the PDB files).  I've created a new installer with workarounds for both of these issue.

The other day I mentioned a way to get debugging working again in VS2003 (by adding a 'bindingRedirect' to Visual Studio's 'devenv.exe.config' file).  Unfortunately this has side effects of its own and prevents the command bar buttons from being installed on a fresh install of TestDriven.NET.  Everything worked just fine assuming TD.NET had already been installed.  If you made this change, I would recommend rolling it back and installing the new version.

There are a couple of other changes worth mentioning.  I've updated the 'QualityTools' test runner so that is works with the latest VSTS 'Test Project's.  I've also improved the plug-in model for test runners.  You'll need this version if you want to use the version of MbUnit on Tigris with TD.NET.  Everything is there to build your own compatible MbUnit installer (using MSBuild + Wix).

You can find the new build here.  Please let me know how you get on so I know when to make a higher profile announcement.

Posted by Jamie Cansdale | 27 comment(s)
Filed under:

Beta2 Breaks 'Test With... Debugger' (in VS2003)

I have finally got the the bottom of the issue mentioned yesterday.  I can confirm that installing VS2005 beta2 or any of the Express products will break 'Test With... Debugger' in VS2003 (or VS2002).  What makes the situation worse it that uninstalling them won't fix the issue!  The good news is that I now have a patch that seems to work.  I'll explain what causes the issue and how the patch works.

To write an add-in that works with both VS2003 and VS2005, the first step is to start compiling against the new Visual Studio interop assembly (EnvDTE, Version 8.0.0.0).  Once you've done this you can detect which version your add-in is running under and register your command bar buttons in the appropriate way (this now differs between VS2002/3 and VS2005).  In theory the new version of EnvDTE.dll is backwards compatable with the old version (Version 7.0.3300.0). This was the case with Beta1 and TestDriven.NET worked fine with VS2003 and VS2005 installed. In Beta2 the EnvDTE (Version 8.0.0.0) assembly has changed and intruduced a new issue.

If you look at the new EnvDTE (Version 8.0.0.0, FileVersion 8.0.50215.44) inside .NET Reflector and 'View Imports' for the 'mscorlib' assembly, you will see the following: 

You can see that Reflector can't resolve the reference to 'IConnectionPoint'!  That is because 'IConnectionPoint' is a new interface in .NET Framework 2.0. This interface is used whenever an add-in registers a COM event listener. In the case of TestDriven.NET, it attempts to register an OnEnterDesignMode listener when 'TestWith... Debugger' is used.  Unfortunately this is now greeted with:

System.TypeLoadException: Could not load type System.Runtime.InteropServices.ComTypes.IConnectionPointContainer from assembly mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.

The workaround here is to force VS2003 to use the original EnvDTE (Version 7.0.3300.0). To do this you need to add a bindingRedirect to VS2003's application config file (probably located at %ProgramFiles%\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe.config). Add the following element underneith the last 'dependentAssembly':

<dependentAssembly>
    <assemblyIdentity name="EnvDTE" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="8.0.0.0" newVersion="7.0.3300.0"/>
</dependentAssembly>

Once you've done this, your VS2003 add-ins should start behaving themselves again. Please comment here and let me know how you get on.  I'd be interested to know what other add-ins this issue is affecting.

Update: It seems 'Test With... Debugger' is no longer very stable in VS2005 beta2.  I'm currently investagating.

Update: Mike Scott, could you try checking the box on the left hand side of TestDriven.NET in the 'Add-in Manager' (on the 'Tools' menu).  If this doesn't fix it, could you try doing that again but with Sysinternals DebugView running in the background.  See if there are any juicy looking exceptions.

Have you Uninstalled VS2005 beta1?

I'm keen to hear from anyone who has uninstalled VS2005 beta1 on a machine with VS2003 installed.  There is an possible issue where uninstalling beta1 breaks 'Test With... Debugger' in VS2003.  I say possible because at the moment it's just a hunch.  Please comment here and let me know whether or not 'Test With... Debugger' is still working (I'm just as keen to know if it still works).  If the issue is consistent then I'll add it as an FAQ.

Update: Thanks for the comments everyone. There does appear to be a new bug when VS2003 and VS2005 beta 2 are installed (related to registering for COM events). VS2003 and VS2005 beta1 worked fine side by side. Unfortunately this doesn't seem to be the case with beta 2.  I don't know if this is an issue with the .NET Framework 2.0 beta 2 in general, with VS2005 beta 2 and/or the Express versions. Please keep the comments coming.

I've just uploaded a new build with a workaround for this issue. It also fixes executing tests using the VSTS test runner. This is a very rushed release (due to this new issue). Please let me know if you notice any quirks.

http://testdriven.net/downloads/TestDriven.NET-1.1.1010d.zip 

 

Posted by Jamie Cansdale | 10 comment(s)
Filed under:

MbUnit @ Tigris Open for Business

If you've been following Peli's blog you will know that he has been swallowed up by the big ship and is now working on the CLR JIT testing team.  This put the future of MbUnit up in the air for a while as the legal situation was clarified with his new employer. Now the dust has settled a bit, it is clear that Peli will only people able to contibute to the project in an advisory capacity. It makes sense for MbUnit to be passed back to the community with a new captain.  I am pleased to announce that Andrew Stopford has stepped forward to take the helm.

In preparation for MbUnit to be maintained on Tigris, I have spun it out of the TestDriven.NET distribution. I have done some work on the TestDriven.NET extensability model so that MbUnit (and other testing frameworks) can plug strait in when installed. Still will allow MbUnit to evolve independently from the relatively stable TestDriven.NET.  I'm also working on plugins for the latest versions of NUnit and VSTS.

Andrew has created a new developers mailing list here:
dev-subscribe@mbunit.tigris.org (please subscribe and ask any questions there)

For the impatient you can find the latest MbUnit/QuickGraph/NGraphviz/Refly here:
:pserver:guest@cvs.tigris.org:/cvs checkout mbunit (password 'guest')

Have a look at 'readme.txt' in 'mbunit\src\src\' (don't ask why it's 'src/src'!!).

Posted by Jamie Cansdale | 9 comment(s)
Filed under:
More Posts