1

I would first like to admit that I am an extremely novice developer, so I'm doing my best to give all of the relevant information to make this question answerable:

So I'm trying to do some unit tests for NxBRE before I start attempting further work with the engine. I've downloaded both NxBRE and NUnit (version 3.2 and 2.6 respectively) and I've tested NUnit to make sure that it is working properly using a simple example that I could post here, but seems irrelevant to do so. What's important was that I was easily able to reference the nunit.framework.dll in the example, and the tested attributes compiled and the GUI ran the tests perfectly. I'm using SharpDevelop by the way.

I then opened up the provided NxBRE solution, which has two projects (NxBRE and NxBRE-UnitTest), added the same reference in the Unit-Test project to the nunit.framework.dll, and attempted to build the solution. I got a compiler error (along with the host of associated errors) stating that:

CS0246: The type or namespace name 'nunit' could not be found (are you missing a using directive or an assembly reference?)

Well, I was pretty sure I wasn't missing either, so I double checked the reference, and it seemed good (in that I re-added it in the way that I had for my test example). I even manually copied the .dll to the directories that were being accessed. I don't think it was an issue with NUnit itself, because I went back to my crafted example and it still ran fine.

Do you have any suggestions for trouble-shooting ideas or techniques that I should try?

Gavin Kramar
  • 204
  • 1
  • 7

1 Answers1

2

I examined the .csproj file of the NxBRE 3 test project, and there is no directory path associated with nunit.framework.

In other words, the test project expects NUnit to be installed in the Global Assembly Cache. Could it be that you have not installed NUnit via its .msi file but rather unpacked it from a .zip file?

My recommendation is that you remove the nunit.framework reference from the test project and then add the reference again by browsing for the actual DLL file in the file system.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114
  • I looked, and it appears you are right on the count that NUnit was not installed into the GAC, but it's not because I failed to install the .msi file. Whatever the reason, is there a simple way to add the nunit.framework to the GAC? I tried browsing for the .dll file and it didn't fix the problem. – Gavin Kramar Jun 25 '12 at 17:51
  • I normally do no bother adding files to the GAC if it is not done automatically, but [here](http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx) is an overview of ways to do that. Of course, you would then need to know where the DLL file in any case... If you have a 64-bit system, have you looked in the _Program Files (x86)/Nunit 2.x.y/bin/framework_ folder? If you find it there, I recommend that you add it manually to your test project. If it's not there, re-install NUnit. – Anders Gustafsson Jun 25 '12 at 17:57
  • After reinstalling and then locating in the directory and adding manually, I got it to work. Thank you so much for your help! – Gavin Kramar Jun 25 '12 at 18:33