Mark77

If I run a set of tests and then try and look at the code coverage I receive an exception:

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:\Work\MyProject\bin\Debug\MyProject.dll

If I go to the debug directory I think all the files are there, e.g.:

MyProject.dll

MyProject.instr.pdb

MyProject.pdb

I've found some articles about this error, but they allr elate to accessing code coverage via code, rather than Studio.

I should add that this project was working fine only a couple of days ago.

Thanks

Mark



Re: Visual Studio Team System - Testing Code Coverage Exception..

Michael Koltachev - MSFT

Mark, I think the issue you have is that the .pdb file is not up to date with the .dll/.coverage file, such as one of [.pdb, .dll] files are newer than the other one, or .coverage file was created with older .dll/.pdb files. All 3 files should be in sync in order to see coverage data: .coverage, .dll, .pdb. Have you rebuilt your project since last time you were able to see coverage data I would recommend a couple of options for you:

- Rebuild you project and re-run the test with code coverage.

- If you still have TestResults directory for test run you want to see coverage data for, open corresponding .trx file, or, if you lost the .trx, go to TestResults\<Test Run Name> directory, and copy .dll/.pdb from the Out subdirectory and .coverage from the In subdirectory to one directory, then double click .coverage file to open it in VS.

Thanks,

Michael





Re: Visual Studio Team System - Testing Code Coverage Exception..

Mark77

Michael,

Many thanks for the reply.

I should of mentioned that after the first few times I got this problem I actually removed all the dlls and pdbs from the project folders to make sure there were no mismatches/old versions. It doesn't solve the problem.

I tried opening the trx, but when you try to expand the coverage results it gives the same error.

I also put everything into one directory as you suggest, but again when you try to expand the results the same error appears.

We think its something in the solution/projects as most of us are getting the problem now. Oddly if I go to our TFS server and look at the builds I can view code coverage results, so whatever ti is isn't affecting TFS.

Thanks

Mark





Re: Visual Studio Team System - Testing Code Coverage Exception..

Mark77

Just a little more info:

I've just deleted all DLLs and PDBs again and rebuilt the solution. If I check the DLLs and PDBs they have the same date and time (21/08/2007 10:14am).

If I then run the tests the DLL is being rebuilt, but the PDB isn't, so I now have a DLL built at 21/08/2007 10:21am and a PDB built at 21/08/2007 10:14am. This is obviously why the code coverage stuff is getting upset.

Why would this be happening To confuse things further if I repeat the process but run all the tests in debug the DLL isn't rebuilt.. but I still don't get to see code coverage as it isn't configured.

Thanks

Mark





Re: Visual Studio Team System - Testing Code Coverage Exception..

Michael Koltachev - MSFT

Mark, sorry for late reply... Well, there could be some mismatch in solution build/code coverage items mismatch with build configuration. Are you using debug or retail configuration

- Have you tried "Rebuild solution" and then run the tests

- Or try to "Clean solution", the run tests.

- Also you can try to open Test->Edit run configurations->Your run config. Then navigate to the code coverage tab, remove the coverage bunary, then add it back. Then run the tests with coverage.

Please let me know if this helped, and which of the approached helped.

Thank you,

Michael