Error using Code Coverage

When i try to view code coverage after a test run, i get the following error (In a message dialog):


Microsoft Visual Studio

Code Coverage Analysis engine threw exception(s):

Error when creating coverage info: Error loading symbol file. Symbol and binary files should be in the same folder as the coverage file or on the symbol path: C:\PathToMyProject\bin\Debug\AssemblyName.dll.


OK

There are probably some path settings that are wrong, but i can't seen to find either the setting for the location of the coverage file, nor can i find a setting for the symbol path. I am assuming these settings are project dependant since all my other project's code coverage work fine.

I hope someone can shed some light on this.

[767 byte] By [JeroenVos] at [2007-12-20]
# 1

Hi Jeroen,

It seems that it cannot find the symbols for some dll.My suggestion would be, to make sure that all the dll (assembly) that you are trying to get code coverage should have respective .pdb files in the same location as the dll(assembly)

Thanks,

Anjana [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.

AnjanaMazumderMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...
# 2

The .pdb file are present in the same location as the compiled assembly files.

Any other suggestions would be welcome.

JeroenVos at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...
# 3

Can you give me more details on what projects you have selected for code coverage? If you have only chosen the projects that already have PDBs in the same folder as the EXEs, then one possibility is that there is some instrumented file lying around from previous code coverage runs that does not have a PDB file and that DLL is loaded somehow during the test run.

If that doesn't work, can you zip up your test project and send it to me if it is not too big?

-Munjal

MunjalD at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...
# 4

I'm working with a large solution fo 30 projects (20 library assembly projects, 10 test projects). I have cleared all output directories of all projects (using the clean solution from VS 2005, and manually), but the problem still persists.

I am afraid every new project i make DOES work, so i can't give you a test project (not to sound harsh but your not getting our production code ).

JeroenVos at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...
# 5

During the execution of your tests are you using other instrumented binaries that are not part of the solution and may not have PDBs? That is one likely reason this can occur.

For example, if you instrumented some binary and GAC'd it or put it in some shared folder and then you forgot to restore the uninstrumented binary. Now if you are referencing that shared binary from one of the projects in your new solution, the instrumented binary will be loaded and hence at analysis time, instrumented PDBs will be needed.

One way to verify that this is not the issue will be to take ths ame solution on a different machine you might have and run there and see if you can repro the problem. If you can't then you have this issue. Otherwise, I will have to get more details on your project/solution structure and what you have selected for coverage to figure out the issue.

MunjalD at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...
# 6

Well, it seems to be a problem in one certain project in the solution. I changed the compiled assembly the unit test was pointing at from one location to another, and the problem solved. (even though there are no differences between the 2 location in the sense of different files present in the location).

I will however copy the solution to my home computer sometime to see if it does the same strange thing there, i still want to fix the problem because the workaround isn't everything.

JeroenVos at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...

Visual Studio Team System

Site Classified