Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
401 views
in Technique[技术] by (71.8m points)

.net - Issue with Code Coverage in VS 2012

I have a simple ASP.Net MVC 4 application with 3 simple tests.

Each of these tests run successfully to completion, however the Code Coverage window gives me the following error:

Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731

I have done some research but nothing has resolved my problem to date.

  • I know the tests run
  • I have .pdb files in the same location as my .dll
  • I am not optimsing by code
  • I cannot find any .testsettings file
  • I Have also run my VS 2012 Ultimate as Administrator, but no luck.

If I find the .coverage file, all it has in it is:

PCH?

Not the xmls results or error message I am expecting.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I realise this is over a year old. Nevertheless I have just encountered exactly the same issue, even down to the "PCH?" text in the .coverage file and have found no solution up 'til now. But surely someone else has had the issue too so, just in case, here's the simple solution:

After checking this MSDN link and following its advice I still had the same issue. So, in the end, I shutdown VS, went to the root solution directory and deleted the .suo file. It has the hidden attribute set so you might need to set explorer to show hidden files.

Restart VS and re-run the code coverage tests. All fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...