添加NUnit 2.6.1参考Visual Studio 2012

Jea*_*ini 4 c# nunit frameworks reference visual-studio-2012

我正在使用Visual Studio 2012,并且我已经下载了NUnit 2.6.1来对代码运行单元测试.我已经在解决方案的项目中添加了对nunit.framework的引用,我将需要它.

问题是,由于某些原因,当我尝试包含命名空间时,它不起作用.它看起来像这样:

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..
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

为什么它不起作用的任何想法?提前致谢!

PS:我使用ReSharper作为VS2012的扩展......这可能是问题的根源吗?

编辑:我尝试使用NUGet多次安装它,但是当NUGet完成安装时我得到了同样的错误:

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

它会进行某种回滚吗?我正在阅读,人们谈论GAC并手动添加参考资料.我对此并不了解,但回答这个问题可能很有用.

Ekk*_*Ekk 5

当我从NUGet安装它时,我有3到4次相同的问题.我通过卸载解决了它并从NUGet重新安装它.