views:

219

answers:

1

I'm struggling a lot trying to get our build server going. I am currently running tests in a Windows XP virtual machine, and have installed TeamCity v5.0.3, build 10821. I am using NUnit v2.5.3.

I finished the initial setup with TeamCity without any issues at all, provided that I use the sln2008 build runner that makes the entire process almost brainless. It's really quite nice that way, and very satisfying to see your first successful automated build.

Now it's time to kick it up a notch and I wanted to get NUnit working. I keep the NUnit 2.5.3 assemblies in an external libs folder in SVN, so I checked that out onto the test system. I selected NUnit 2.5.3 from the build runner options, as the online instructions had recommended. But when I build, I get the following error:

Window1.xaml.cs(14,7): error CS0246: The type or namespace name ‘NUnit’ could not be found (are you missing a using directive or an assembly reference?) 
Window1.xaml.cs(28,10): error CS0246: The type or namespace name ‘Test’ could not be found (are you missing a using directive or an assembly reference?) 
Window1.xaml.cs(28,10): error CS0246: The type or namespace name ‘TestAttribute’ could not be found (are you missing a using directive or an assembly reference?)

Everything compiles great in the IDE.

From finding blog posts and submitting comments, I got some advice and confirmed the following:

  • I have the HintPath value set properly in my project file (points to the external lib)
  • I can also do a full Release and Debug build from the command line using msbuild
  • I have tried do use the NUnit installer so nunit.framework.dll gets registered into the GAC
  • I have changed the build agent's logon account to be a user on the test system, rather than LOCAL SYSTEM.

Nothing seems to help... can anyone else here offer me some advice on what to try next?

+1  A: 

I have gotten this to work, but not in the configuration that I really want. It turns out that on my machine, for whatever reason, when I installed NUnit 2.5.3, nunit.framework.dll was not registered in the GAC.

You can figure this out by entering gacutil /l | find /i "nunit" at the VS2008 command prompt. So I just installed it with gacutil /i.

Then I re-ran the sln2008 build runner, and it completed okay.

I just realized that while the build completed, TC's NUnit runner failed to actually execute any unit tests. It basically told me that the "...\bin\debug doesn't exist". ???

Unfortunately, what I really need is for this to work without NUnit in the GAC, because I have all of my systems referencing nunit.framework.dll in an external libs folder that is saved in SVN.

Currently, my options are:

  • ensure that all systems have the same version of NUnit installed (in the same location, too?)
  • have TeamCity somehow uninstall and then reinstall nunit.framework.dll from SVN every time it does a build

UPDATE

I finally figured it out. Another user error... I only looked at the short log to try to determine my problem, and only after looking at the full log did I realize that my relative path to nunit.framework.dll was wrong. Once I did that (and also had to specify all assemblies to have NUnit test), everything built and my tests are now running. This is pretty sweet!

Dave