Skip to content

Cannot navigate to source file from failing test stack trace (file not found) in Dev Container #2694

@joaoopereira

Description

@joaoopereira

Describe the Issue

When running failing tests in VS Code using C# Dev Kit, clicking a stack trace entry should open the corresponding file and line.
However, VS Code shows “The editor could not be opened because the file was not found”, even though the file exists inside the Dev Container and the repository.

This breaks the standard test → failure → navigate to source workflow.

Steps To Reproduce

  1. Open a C# project inside a Dev Container
  2. Run tests (e.g. via Test Explorer)
  3. Ensure at least one test fails and produces a stack trace
  4. Click a stack trace entry pointing to a source file (e.g. HtmlGulpPackageTypeHandler.cs:34)
Image
  1. VS Code shows an error saying the file cannot be found
Image

Expected Behavior

Clicking a stack trace entry should:

  • Open the corresponding source file
  • Navigate to the exact line where the exception occurred

Actual Behavior

VS Code displays:

Unable to open HtmlGulpPackageTypeHandler.cs
The editor could not be opened because the file was not found.

Even though:

  • The file exists in the workspace
  • The path is valid inside the Dev Container
  • The stack trace includes a full path like:
    file:///workspaces/cli/cmf-cli/Handlers/PackageType/HtmlGulpPackageTypeHandler.cs#L34

Environment Information

  • OS (host): macOS
  • VS Code: Latest stable
  • C# Dev Kit: 1.90.2
  • .NET SDK: Provided by Dev Container
  • Dev Container: Yes
  • Remote: Dev Containers extension

Dev Container Configuration

Using this Dev Container definition:
https://github.com/criticalmanufacturing/cli/blob/development/.devcontainer/devcontainer.json

Metadata

Metadata

Assignees

Labels

area-testTest discovery, execution, debuggingbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions