According to this schema VS2010 Premium and Ultimate has a tool for checking Code Coverage - together with a few other testing tools. Does this support nUnit too, or just MS
Theoretically, it should. There is even documentation for it on MSDN. Basically, you need to set up a "generic test project" which wraps the NUnit test. In practice, I've been trying to get it to work for almost three hours now and it still doesn't. The assembly is instrumented, but there are no coverage results.
I always get this message: "Empty results generated: none of the instrumented binary was used. Look at test run details for any instrumentation problems.", but no problems are reported in that file.
Also, a VSPerf error in the event log pops up. I submitted this as a bug to Microsoft. However, this might be related to my machine. Since I submitted that bug just now, I don't know yet whether others can reproduce the issue or not.
Many of the answers in this thread helped me a lot, but it's hell to get all the little details from multiple answers.
I compiled a list of 6 hints that together with the marked answer by Scott Weinstein did the trick for me: Running NUnit tests in Visual Studio 2010 with code coverage
Although I don't deserve upvotes on both answers, just spare me downvotes for copying:
Upvote them!
You need to turn off shadowcopy in NUnit to get it to work. To do so, use the /noshadow flag.
e.g. C:\Program Files (x86)\NUnit 2.6\bin\nunit-console-x86.exe MyLibrary.dll /noshadow