`dotnet.generateAssets` persists C# Dev Kit temporary solution paths in build and publish tasks
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- csharp, typescript, vscode
- 领域
- build-system, tooling
调研方向
从 src/shared/assets.ts 中的 getBuildProjectPath() 和 getBuildPath() 开始,然后检查 dotnet/vscode-csharp#9704 中引用的现有 watch 路径更改。在 Windows 驱动器之间复现资产生成,并验证生成的 build、publish 和 watch 任务使用选定的相对于 workspace 的 .csproj 路径,而不是临时 solution。
由索引模型根据 Issue 内容生成。
描述
Type: Bug
Summary
dotnet.generateAssets can persist C# Dev Kit’s temporary solution path in generated tasks instead of the application’s .csproj. This produces machine-specific configuration and, when the workspace and temporary solution are on different Windows drives, an invalid path.
This affects Container Tools’ Add Docker Files to Workspace command, which delegates .NET asset generation to the C# extension. Tracked downstream in microsoft/vscode-containers#605.
Steps to reproduce
- Install the C# and C# Dev Kit extensions.
- Create an ASP.NET Core project without a solution file on a drive different from VS Code’s user-data directory:
dotnet new mvc -o D:\Sandbox\ExampleApp - Open that folder in VS Code and allow Dev Kit to load it in workspace mode.
- Run Containers: Add Docker Files to Workspace, selecting ASP.NET Core and Linux.
- Inspect the generated
.vscode/tasks.jsonand run thebuildtask.
Container Tools invokes:
vscode.commands.executeCommand(
'dotnet.generateAssets',
undefined,
{ skipPrompt: true }
);
Reproduced with:
- Container Tools 2.5.0
- C# 2.140.9
- C# Dev Kit 3.20.207
- .NET SDK 10.0.400
- Windows, with the project on
D:and VS Code user data onC:
Actual behavior
The generated build, publish, and watch tasks reference a path shaped like:
./${workspaceFolder}/c:/Users/<user>/AppData/Roaming/Code/User/workspaceStorage/<id>/ms-dotnettools.csdevkit/ExampleApp.sln
The build fails with:
MSBUILD : error MSB1009: Project file does not exist.
The original temporary solution does exist on C:. The generated argument is malformed. Building the actual .csproj succeeds.
Even without the cross-drive failure, persisting a solution under VS Code’s workspace storage makes the configuration dependent on the generating user’s environment.
Expected behavior
Persist the selected project’s workspace-relative path in build, publish, and watch tasks, regardless of whether Dev Kit is installed:
${workspaceFolder}/ExampleApp.csproj
Checked-in configuration should work for teammates using the C# extension and .NET SDK without requiring Dev Kit or its generated temporary solution.
Investigation
getBuildProjectPath()prefers any nonemptysolutionPathoverprojectPath.getBuildPath()unconditionally joins${workspaceFolder}withpath.relative(workspace, target). Across Windows drives, the latter returns an absolute path, making the join invalid.
Solution preference was introduced by commit 7fb0321. Dev Kit’s solution-free workspace behavior exposes this by creating solutions outside the workspace.
dotnet/vscode-csharp#9704 already changes watch to use the project path. Build and publish still prefer the solution.
Suggested resolution
Prefer project paths for newly generated persisted tasks, leaving existing user-authored tasks unchanged.
If solution-based build/publish defaults must be retained, please expose a supported dotnet.generateAssets option to request project-based tasks. Currently, selectedIndex selects a project but does not override solution preference, and skipPrompt only controls the Dev Kit recommendation dialog.
Such an option would let Container Tools request portable configuration without duplicating C# asset generation or post-processing tasks.json and launch.json.
Extension version: 2.140.9
VS Code version: Code 1.137.0 (645f29cc3176500b4b5762ba887cf2a7f0ffdf2c, 2026-09-08T13:43:59-07:00)
OS version: Windows_NT x64 10.0.26200
Modes:
Logs
C# log
2026-09-10 12:01:59.170 [info] Locating .NET runtime version 10.0.5
2026-09-10 12:01:59.455 [info] Dotnet path: C:\Program Files\dotnet\dotnet.exe
2026-09-10 12:01:59.455 [info] Activating C# + C# Dev Kit...
2026-09-10 12:02:00.047 [info] info: Program[0]
2026-09-10 12:02:00.047 [info] Server started with process ID 9236
2026-09-10 12:02:00.875 [info] [Program] Language server initialized
2026-09-10 12:02:00.877 [info] [Program] Monitoring client process 9804 for exit
2026-09-10 12:02:01.531 [info] [initialized] [Microsoft.CodeAnalysis.LanguageServer.FileBasedPrograms.FileBasedProgramsEntryPointDiscovery] Finished discovery in 'd:\Sandbox\ContainersIssue605-55ffe9f3' in 9 milliseconds
2026-09-10 12:02:04.881 [info] [serviceBroker/connect] [WorkspaceProjectFactoryService] Project D:\Sandbox\ContainersIssue605-55ffe9f3\ContainersIssue605.csproj loaded by C# Dev Kit
C# LSP Trace Logs log
Environment Information
VSCode version: 1.137.0
C# Extension: 2.140.9
Using OmniSharp: false
Dotnet Information
.NET SDK: Version: 10.0.400 Commit: 14fbf8d527 Workload version: 10.0.400-manifests.b0ae88bd MSBuild version: 18.9.6+14fbf8d52Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.400\
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 10.0.12
Architecture: x64
Commit: 95017c711e
.NET SDKs installed:
8.0.425 [C:\Program Files\dotnet\sdk]
9.0.318 [C:\Program Files\dotnet\sdk]
10.0.400 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
DOTNET_CLI_UI_LANGUAGE [en-US]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
| Extension | Author | Version | Folder Name |
|---|---|---|---|
| azure-dev | ms-azuretools | 0.10.0 | ms-azuretools.azure-dev-0.10.0 |
| csdevkit | ms-dotnettools | 3.20.207 | ms-dotnettools.csdevkit-3.20.207-win32-x64 |
| csharp | ms-dotnettools | 2.140.9 | ms-dotnettools.csharp-2.140.9-win32-x64 |
| debugpy | ms-python | 2026.6.0 | ms-python.debugpy-2026.6.0-win32-x64 |
| esbuild-problem-matchers | connor4312 | 0.0.3 | connor4312.esbuild-problem-matchers-0.0.3 |
| memento-explorer | bwater | 0.1.7 | bwater.memento-explorer-0.1.7 |
| native-preview | TypeScriptTeam | 0.20260708.2 | typescriptteam.native-preview-0.20260708.2-win32-x64 |
| python | ms-python | 2026.4.0 | ms-python.python-2026.4.0-win32-x64 |
| remote-containers | ms-vscode-remote | 0.469.0 | ms-vscode-remote.remote-containers-0.469.0 |
| remote-explorer | ms-vscode | 0.5.0 | ms-vscode.remote-explorer-0.5.0 |
| remote-ssh | ms-vscode-remote | 0.128.0 | ms-vscode-remote.remote-ssh-0.128.0 |
| remote-ssh-edit | ms-vscode-remote | 0.87.0 | ms-vscode-remote.remote-ssh-edit-0.87.0 |
| vscode-azure-github-copilot | ms-azuretools | 1.0.231 | ms-azuretools.vscode-azure-github-copilot-1.0.231-win32-x64 |
| vscode-azure-mcp-server | ms-azuretools | 2.0.46 | ms-azuretools.vscode-azure-mcp-server-2.0.46-win32-x64 |
| vscode-azureappservice | ms-azuretools | 0.27.0 | ms-azuretools.vscode-azureappservice-0.27.0 |
| vscode-azurefunctions | ms-azuretools | 1.22.1 | ms-azuretools.vscode-azurefunctions-1.22.1 |
| vscode-azureresourcegroups | ms-azuretools | 0.12.7 | ms-azuretools.vscode-azureresourcegroups-0.12.7 |
| vscode-containers | ms-azuretools | 2.5.0 | ms-azuretools.vscode-containers-2.5.0 |
| vscode-dotnet-runtime | ms-dotnettools | 3.1.0 | ms-dotnettools.vscode-dotnet-runtime-3.1.0 |
| vscode-eslint | dbaeumer | 3.0.34 | dbaeumer.vscode-eslint-3.0.34 |
| vscode-pull-request-github | GitHub | 0.166.0 | github.vscode-pull-request-github-0.166.0 |
| vscode-pylance | ms-python | 2026.3.1 | ms-python.vscode-pylance-2026.3.1 |
| vscode-remote-extensionpack | ms-vscode-remote | 0.26.0 | ms-vscode-remote.vscode-remote-extensionpack-0.26.0 |
| vscode-yaml | redhat | 1.24.0 | redhat.vscode-yaml-1.24.0 |
C# Settings
| Setting | Value |
|---|---|
| preferCSharpExtension | false |
| compilerDiagnosticScope | openFiles |
| analyzerDiagnosticScope | openFiles |
| enableXamlTools | true |
| useServerGC | true |
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz (20 x 3696) |
| GPU Status | 2d_canvas: enabled GPU0: VENDOR= 0x8086, DEVICE=0x9bc5 [Intel(R) UHD Graphics 630], DRIVER_VENDOR=Intel, DRIVER_VERSION=30.0.101.1273 ACTIVE GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.9278 Machine model name: Machine model version: direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off trees_in_viz: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | undefined |
| Memory (System) | 126.84GB (102.06GB free) |
| Process Argv | --log ms-azuretools.azureextensionui=trace --log ms-azuretools.vscode-containers=debug --log ms-azuretools.vscode-azure=debug --crash-reporter-id 346e43a8-9268-4087-a447-da84e0fdc384 |
| Screen Reader | yes |
| VM | 0% |
- 主要语言
- TypeScript
- 星标
- 3.1k
- 派生
- 738
- 平均合并
- 21 小时 21 分钟
- 30 天内合并 PR
- 42
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/vscode-csharp 的其他 Issue
-
Infrastructure Test
难度 2/5 1-3 小时 新手友好度 70/100
dotnet/vscode-csharp#9791 · 1 条评论 ·
维护者通常 1 天内回复
-
C# crash未关闭Bug C#DK Needs More Info Reliability Remote Extensions Roslyn LSP
难度 4/5 3-5 天 新手友好度 25/100
dotnet/vscode-csharp#9807 · 1 条评论 ·
维护者通常 1 天内回复
-
Editor-Formatting Resolved-Configuration Issue
难度 3/5 1-2 天 新手友好度 65/100
dotnet/vscode-csharp#9804 · 6 条评论 ·
维护者通常 1 天内回复
-
Bug Debugger
难度 3/5 1-2 天 新手友好度 68/100
dotnet/vscode-csharp#9802 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
untriaged
难度 4/5 3-5 天 新手友好度 58/100
dotnet/vscode-csharp#9787 · 6 条评论 ·
维护者通常 1 天内回复
查看 dotnet/vscode-csharp 的全部 Issue
相似的 Issue
-
area/frontend good first issue kind/cooldown
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
voidzero-dev/oxc-angular-compiler#511 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
langchain-ai/deepagentsjs#898 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
anomalyco/models.dev#8509 · 2 条评论 ·
维护者通常 1 天内回复
-
bug documentation P2 UI/UX
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复