5

Test which use Microsoft Fakes Framework fail with exception:

Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables 2016-12-26T14:36:01.6005889Z ##[error] at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.IntelliTraceInstrumentationProvider.ResolveProfilerPath() 2016-12-26T14:36:01.6005889Z ##[error] at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.IntelliTraceInstrumentationProvider.Initialize() 2016-12-26T14:36:01.6005889Z ##[error] at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InitializeUnitTestIsolationInstrumentationProvider()

Tests debug and run fine on local machine VS2015 but when build in TFS2015 I keep getting this exception. I tried by removing runsettings file path, the build passed but tests didn't run it that case. I have gone through various forums on MSDN none of the solutions fixing my problem. Is there any way to set these environment variables in TFS? Am pretty much blocked here, any suggestions and solutions are welcomed.

Usama Aslam
  • 437
  • 7
  • 18
  • According to the similar issue https://connect.microsoft.com/VisualStudio/feedback/details/817243/unittestisolationexception-occurs-when-debugging-tests-using-shimscontext Did you try to update your build server and TFS server to 2015.update3? Which may fix the issue. – PatrickLu-MSFT Dec 27 '16 at 08:46
  • Try to go to TFS build agent machine, and run the tests locally, what result will you get? – Cece Dong - MSFT Dec 29 '16 at 09:23

1 Answers1

6

Alright, issue was pretty stupid. Fakes require enterprise version. I was using enterprise edition on local machine but VSTS was using community edition. Installing enterprise edition solved the problem. That exception was thrown because intellitrace is required for profiling and that was not available in community edition.

Usama Aslam
  • 437
  • 7
  • 18