Tuesday, April 10, 2012

NuGet not installing NUnit 2.6x tools in Visual Studio .net 2010

I've been working on learning ASP .NET MVC 3 and started a video tutorial from PluralSight - very informative and goes step-by-step to build on learning.

I issue I came across was using the the NuGet utility to add the NUnit package and references to do unit testing. The current version is 2.6x, and the instruction from PluralSight was provided with 2.5x; I found the current version a bit harder to set up than the demo showed. When I used NuGet to get the needed packages for the test project, although it added the needed references, it didn't install the nunit-console (at least I couldn't find it) in the solution directory [$(SolutionDir)\packages\NUnit.2.6.0.12054\tools\nunit-console].

The following has seemed to remedy the issue:
  • Go to the NUnit site and downloaded the .msi.
  • Once installed (by double-clicking the downloaded msi), copy needed files in the install directory [C:\Program Files (x86)\NUnit 2.6\bin]
  • Paste in [$(SolutionDir)\packages\NUnit.2.6.0.12054\tools\]
That did it - the post-build event command line code of the test class library executed without issue. For reference, here is the command line:
$(SolutionDir)\packages\NUnit.2.6.0.12054\tools\nunit-console $(TargetPath)


7 comments:

  1. Looking at it, they appear to have moved out the console into a new package called NUnit.Runners, which contains the necessary files including the console.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Faced the same issue while implementing the stuff mentioned in PluralSight MVC3 video practically with NUnit-2.6. Your post helped me. Thanks.

    ReplyDelete
  4. Fortunately I had an old version of NUnit in one of my other projects but this is really helpful, thank you! I have been watching exactly the same Pluralsight video myself and you are right, they are fantastic videos, especially this one on MVC3. I only hope that replying to this will give your post a higher chance of being viewed by other people having the same issues.

    ReplyDelete
  5. Same thing - PluralSight video mvc3 - This post helped me get the GUI
    Thx

    ReplyDelete
  6. Can I add to the list of folks your post has helped? Thanks. Same issue, now with NUnit.3.4.1

    ReplyDelete