1. I have Integrated SonarQube
  2. Installed Visual Studio 2022 EnterPrise Edition - Test Project in c# code base
  3. Installed the coverlet for Unit Test Code Coverage for Test Project
  4. with command line getting the below error: coverlet "./Application.Tests/bin/Debug/Application.Tests.dll" --target "dotnet" --targetargs "test "./Application.Tests/Application.Tests.csproj" --no-build" -f=opencover -o="coverage.xml"

Error Message: Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException :Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables. Stack Trace: at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.IntelliTraceInstrumentationProvider.ResolveProfilerPath() at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.IntelliTraceInstrumentationProvider.Initialize() at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InitializeUnitTestIsolationInstrumentationProvider() at Microsoft.QualityTools.Testing.Fakes.Shims.ShimRuntime.CreateContext()

Getting error while running coverlet command line coverlet "./Application.Tests/bin/Debug/Application.Tests.dll" --target "dotnet" --targetargs "test "./Application.Tests/Application.Tests.csproj" --no-build" -f=opencover -o="coverage.xml"

** Error Message:** Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException :Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables.

Expected: Need to overcome from this error.

1

There are 1 best solutions below

0
Prabhuraj Desai On

For dot net core Test Project coverlet "./Application.Tests/bin/Debug/Application.Tests.dll" --target "dotnet" --targetargs "test "./Application.Tests/Application.Tests.csproj" --no-build" -f=opencover -o="coverage.xml"

For dot net framework Test Project coverlet "./Application.Tests/bin/Debug/Application.Tests.dll" --target "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" --targetargs "./Application.Tests/bin/Debug/Application.Tests.dll" -f=opencover -o="coverage.xml"