DotCover in Teamcity stopped reporting coverage after project upgrade to .NET 8

Teamcity was correctly reporting coverage with .NET 7 with the following Kotlin DSL Configuration:

dotnetTest {
            name = "Run Unit Tests"
            projects ="XXX.Tests/XXX.Tests.csproj"
            configuration = "Debug" // Run tests in Debug configuration
            coverage = dotcover {
                toolPath = "%teamcity.tool.JetBrains.dotCover.CommandLineTools.DEFAULT%"
                assemblyFilters = """
                    -:*.Tests
                    -:Microsoft.VisualStudio.TestPlatform.*
                """.trimIndent()
            }
        }

 

After upgrading project to .NET 8 there is no coverage and I see the following warning in teamcity:

 No source files were found under the build checkout directory XXX. No source files will be included in dotCover report as source code of classes
 
 ...
 DotCover statement coverage was: 0 of 0 ( -1.0%)

18:12:41 
No executable code was detected. 

The issue could be caused by one of the following:

- Include / exclude patterns are incorrect

- Assemblies are compiled without debugging information

- .pdb files are not available

- Visual Studio code coverage is enabled for MSTest

- .testrunconfig is used for MSTest and Visual Studio code coverage is not disabled (CodeCoverage section with enable="true" is present)
2
2 comments

Hi Roman,

It is a known issue TW-85181. Please check if any of the following environment variables are set with a 0 value on build agents:

  • COMPlus_EnableDiagnostics
  • COMPlus_EnableDiagnostics_Profiler
  • DOTNET_EnableDiagnostics
  • DOTNET_EnableDiagnostics_Profiler

The solution is to remove such a variable from the environment or change its value to `1` 

0

Thank you Alexander, I think it's a different issue since my build is not stuck, but reports no coverage results.

I will check if adding those variables work otherwise I will create a new ticket

0

Please sign in to leave a comment.