Skip to content

[Known Build Error] DotnetNewTestTemplatesTests.MSTestAndPlaywrightProjectTemplate_...CanBeInstalledAndTestsArePassing fails with UnauthorizedAccessException: Access to the path 'testhost.exe' is denied #55174

Description

@nagilson

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build?definitionId=175 (dotnet-sdk-public-ci)
Leg Name: TemplateEngine: windows (x64)Run TemplateEngine Tests (dotnet-new.IntegrationTests, net10.0, x64)

This is a transient, machine-level file-lock race observed during build-duty triage. The Known Issue validation section below is populated automatically by the bot once it correlates the ErrorMessage signature against build telemetry.

Error Details

The dotnet-new integration test
Microsoft.DotNet.Cli.New.IntegrationTests.DotnetNewTestTemplatesTests.MSTestAndPlaywrightProjectTemplate_WithCoverageToolAndTestRunner_CanBeInstalledAndTestsArePassing
intermittently fails on Windows legs while running dotnet test for the generated MSTest + Playwright project.

The test scaffolds an MSTest/Playwright project (targetFramework net10.0, coverlet coverage tool, VSTest test runner, runDotnetTest: true) and then invokes the test run. During the run, the build/copy step cannot overwrite testhost.exe because it is still locked by a lingering testhost/dotnet process from a prior operation, producing a System.UnauthorizedAccessException:

System.UnauthorizedAccessException : Access to the path 'testhost.exe' is denied.

This is environmental/transient (a process-shutdown / file-handle timing race on the CI agent) rather than a product regression, so matching builds should be retried automatically.

Error Message

{
    "ErrorMessage": [
        "MSTestAndPlaywrightProjectTemplate_WithCoverageToolAndTestRunner_CanBeInstalledAndTestsArePassing",
        "Access to the path 'testhost.exe' is denied"
    ],
    "BuildRetry": true,
    "ExcludeConsoleLog": false
}

Note

This issue was drafted with the assistance of an AI agent (GitHub Copilot) during build-duty triage, and reviewed before filing.

Known issue validation

Build: 🔎
Result validation: ⚠️ Validation could not be done without an Azure DevOps build URL on the issue. Please add it to the "Build: 🔎" line.
Validation performed at: 7/7/2026 5:32:17 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions