Test execution failure when code coverage enabled in VSTest.Console.exe (micrsoft.qualitytools.testing.fakes.unittest….)

http://phoenix-dancing.com/wp-json/oembed/1.0/embed?url=http://phoenix-dancing.com/ A while ago i came across an issue where unit test cases written on shims framework use to fail with below exception This use to happen once we enable code coverage profiling.

http://wordsbroadcast.com/about The unit testing tool that we were using was vstest.console.exe…

The interesting part of this issue was when we use to run the test cases selectively (per project) then it use to pass, however use to fail when we use to run all for all projects….. This issue i replicated both on local developer box and build machines…

buy viagra in us best place to buy priligy Exception…

micrsoft.qualitytools.testing.fakes.unittestisolationexception

unittestisolation instrumentation failed to initialize. please restart visual studio and run this test…

at

Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.

InitializeUnitTestIsolationInstrumentationProvider()

Mcrosoft.QualityTools.Testing.Fakes.Shims.ShimRuntime.CreateContext()

at Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create()

A details analysis suggested that Vstest.console.exe invoke a new code profiler called codecoverage.exe unlike VSPerfmon.exe that we use to see during MSTest.exe days back in Visual Studio 2010 or earlier…

Certainly this code profiler has some issue with VSTest.Console.exe command line and due to which it fails with above exception all the time..

Well i needed a solution to this problem and eventually as you always say “old is gold”, VSPerfmon worked for me.. So what i did was, i enabled profiling using vspefmon and ran tests using vstest.console.exe and it worked…

Here are the detailed steps…

enable code profiling as mentioned below, however i use vstest.console.exe instead of MSTest.exe as MSTest.exe version 11.0 doesn’t support shim testing framework …

 

Standalone profiling of code (code coverage for third party testing tools)

 

Leave a Reply

Your email address will not be published. Required fields are marked *