Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding NUnit 2.6.1 reference Visual Studio 2012

I'm using Visual Studio 2012, and I've downloaded NUnit 2.6.1 to run Unit Tests on the code. I've added the reference to nunit.framework in the project of the solution where I'll be needing it.

The problem is, for some reason when I try to include the namespace it doesn't work. It looks like this:

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;  //This is not working here

namespace SomeNamespace
{
    [TestFixture]  //This is not recognized..
    public class SomeClassTest
    {
        [Test]  //Neither recognized..
        public void SomeMethodTest()
        {
            //Ok some implementation goes here..
        }
    }
}

Any ideas on why it's not working? Thanks in advance!

PS: I'm using ReSharper as an extension for VS2012... Can this be the source of the problem?

EDIT: I've tried to install it several times using NUGet, but I get the same error when NUGet finishes installing:

Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))
Successfully uninstalled 'NUnit 2.6.1'.
Install failed. Rolling back...
Failed to add reference to 'nunit.framework'.

It makes some sort of rollback? I was reading and people say something about the GAC and adding references by hand. I don't know much about this, but could be useful to answer the question.

like image 523
Jean Carlos Suárez Marranzini Avatar asked Feb 19 '23 19:02

Jean Carlos Suárez Marranzini


1 Answers

I have the same problem for 3 to 4 times when I installed it from NUGet. I resolved it by uninstall and reinstall it from NUGet.

like image 198
Ekk Avatar answered Feb 21 '23 08:02

Ekk