Skip to content

C# Dev Kit writes an untracked runfile-discovery cache into the workspace #9767

Description

@anthonymastreanvae

C# Dev Kit writes an untracked runfile-discovery cache into the workspace

Environment

  • VS Code with Dev Containers
  • C# Dev Kit 3.20.207
  • C# extension 2.140.9
  • Generic Debian-based Dev Container
  • .NET SDK 10.0.400
  • Linux host with Docker Desktop

Reproduction

A minimal standalone workspace contains:

.devcontainer/devcontainer.json
Repro.csproj
Program.cs

The Dev Container enables the .NET feature and the ms-dotnettools.csdevkit extension.

The complete repro files are:

.devcontainer/devcontainer.json

{
	"name": "C# Dev Kit runfile cache repro",
	"image": "mcr.microsoft.com/devcontainers/base:debian13",
	"features": {
		"ghcr.io/devcontainers/features/dotnet:2": {
			"version": "10.0"
		}
	},
	"customizations": {
		"vscode": {
			"extensions": [
				"ms-dotnettools.csdevkit"
			]
		}
	},
	"remoteUser": "vscode"
}

Repro.csproj

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFramework>net10.0</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
	</PropertyGroup>
</Project>

Program.cs

Console.WriteLine("C# Dev Kit runfile discovery repro");

After opening the workspace in its own Dev Container and waiting for C# Dev Kit project discovery to finish:

git status --short --untracked-files=all
find . -path '*runfile-discovery*' -o -name 'cache.staging.json'

Actual behavior

C# Dev Kit creates this untracked file beneath the workspace:

dotnet/runfile-discovery/<opaque-workspace-id>/cache.staging.json

Docker Desktop confirms that the container has only the normal workspace bind mount. The cache is created inside the workspace, not through an additional host mount.

The cache contains project-discovery metadata, including the workspace path and discovered project information.

Expected behavior

Project-discovery cache data should be stored in extension or user cache storage outside the repository workspace, or be excluded from Git automatically.

Impact

Repositories opened with this configuration receive an unexpected generated file under their working tree. Users must discover and ignore an undocumented tool-generated directory manually.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugFeature - Run File#: and #! directives and file-based C# programs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions