I've tried using the sample from http://blogs.msdn.com/ms_joc/articles/406608.aspx to get the off-road experience of code coverage. However, when I run the tests on my instrumented binary, I'm getting the coverage results for the test project instead of my instrumented binary. Am I missing something here!

code coverage "off road"
Bilgehan
Here are some things to check on that might help:
1) Don't instrument the test binaries unless you want coverage data on them.
2) Make sure you execute the same assembly you instrumented.
3) If the assembly is registered in the registry or is accessed by path, make sure you've instrumented the one being picked up.
4) When you start the monitor (vsperfmon.exe) do you see the console window If so, verify the assembly gets registered when you execute it. If you don't see it, you aren't executing the instrumented assembly.
Chris
Microsoft Corporation
Dmitry Vasilevsky MSFT
Can you send me information about TS-ing into your machine via email to munjald@microsoft.com I am pretty sure the problem is very basic (especially since it is a C# console application after all) and I will not take long before I find out the real problem.
Please send information about login credentials and the project path, etc. and the steps you are performing.
Martin Szugat
Will try again and let you know if I hit on something!
MaTT_17
Adatacorp
Aicos
I'm instrumenting my assembly and able to generate the .instr file, and executing the mstest.exe using the testcontainer switch and loading the testproject dll that houses the tests for my assembly.
However, vsperfmon is not picking the instrumented assembly. Is there any way that I can tell vsperfmon to load a particular instrumented assembly Do I need to do this I'm using
vsperfmon - coverage /output:@"E:\samples\MyCoverage.coverage"
Fairy
I think it is time you check the path of the module loaded into the vstesthost.exe process to find out what binary is actually loaded versus what binary is instrumented.
Did you already verify that the binary being instrumented is not in the bin directory of the console application but in the bin directory of the test project
If nothing works, just let me TS into your machine and I will find out the issue.
-Munjal (MS)
Elfman
If you try the following, you should get data on the executable. Does this work for you If it does, make sure the test project is calling this executable.
1) Build the project
2) vsinstr -coverage realcode.exe
3) vsperfmon -coverage -output:realcode.coverage
4) realcode.exe
5) vsperfcmd -shutdown
Cobo
Ron A. Buckton
I've tried the very steps, yet unable to get coverage info for my assembly. Still continuing to get results for the test project :(
Scenario 3: Product and Test Binaries Only - is my current scenario
Joey.Liang
That is, let's say you have the following folder structure:
Solution1
--> ConsoleApplication1
--> TestProject1
And you have a reference from the test project to the console application. That is you have the following files:
Solution1
--> ConsoleApplication1
-->bin
--> Debug
--> ConsoleApplication1.exe
--> TestProject1
-->bin
--> Debug
--> TestProject1.dll
--> ConsoleApplication1.exe
I think you are instrumenting Solution1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe while you should actually be instrumenting Solution1\TestProject1\bin\Debug\ConsoleApplication1.exe
One way to easily locate the problem (or confirm that you are doing the above thing) is to attach a debugger to VSTestHost.exe (that is the process that mstest.exe will ultimately call) and look into the modules view what is the path for consoleapplication1.exe being loaded.
Hope this helps. Let us know what you find out.
-Munjal (MS)
Sillychuckie
I assume you're doing something like the following. Is this right
1) Build the project
2) Build the test project
3) vsinstr -coverage realcode.dll
4) vsperfmon -coverage -output:mycoverage.coverage
5) mstest /testcontainer:testproject.dll ...
6) vsperfcmd -shutdown