Tuesday, July 19, 2005

Unit Testing CAB

One of the common problems reported with unit testing CAB via NUnit is the fact that the NUnit GUI crashes when executing the test. This is particular true with the Windows Forms unit test. To solve the problem we need to load the nunit-gui.exe application in a FX 2.0 environment. We can affect this by making the following change to the nunit-gui.exe.config file

<startup>
<supportedRuntime version="v2.0.50215" /> <!-- .NET 2.0 BETA 2 --> <supportedRuntime version="v2.0.40697" /> <!-- .NET 2.0 BETA 1 --> <supportedRuntime version="v1.1.4322" /> <!-- .NET 1.1 RTM --> <supportedRuntime version="v1.0.3705" /> <!-- .NET 1.0 RTM -->

<requiredRuntime version="v1.0.3705" />
</startup>

You can also try using TestRunner instead of NUnit and you will not have this problem at all.