Skip to content

If C# Dev Kit is not installed, programmatically calling command dotnet.generateAssets does not work #8389

@bwateratmsft

Description

@bwateratmsft

Type: Bug

Issue Description

If C# Dev Kit is not installed, programmatically calling command dotnet.generateAssets does not work. The Container Tools extension uses this command and the tasks it generates to debug .NET apps within a container.

Steps to Reproduce

  1. Install C# and Container Tools extensions, but do not install C# Dev Kit.
  2. Create and open a .NET MVC project.
  3. In the command palette, run the command "Containers: Add Docker files to workspace...". Follow the prompts to scaffold Docker files for .NET: ASP.NET Core.
  4. (Behind the scenes, during the above step, the Container Tools extension will call dotnet.generateAssets, but nothing happens.)
  5. Try running the debug profile "Containers: .NET Launch"

Expected Behavior

Debugging works

Actual Behavior

Debugging starts, but fails because the app is not built

I suspect the root cause of the issue is that this line is returning false instead of true:

When promptForDevKitDebugConfigurations gets called, without C# Dev Kit installed, that function will always return false. Above on this line, it will cause the function for dotnet.generateAssets to immediately return:

if (!(await promptForDevKitDebugConfigurations())) {
return;
}

Logs

Nothing noteworthy

C# log

Nothing noteworthy

C# LSP Trace Logs

Nothing noteworthy

Environment information

VSCode version: 1.101.2
C# Extension: 2.80.16
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 10.0.100-preview.5.25277.114 Commit: ddf39a1b46 Workload version: 10.0.100-manifests.a07d1f1a MSBuild version: 17.15.0-preview-25277-114+ddf39a1b4

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\

.NET workloads installed:
[aspire]
Installation Source: VS 17.14.36221.1
Manifest Version: 8.2.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Install Type: Msi

Configured to use workload sets when installing new manifests.
Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.

Host:
Version: 10.0.0-preview.5.25277.114
Architecture: x64
Commit: ddf39a1b46

.NET SDKs installed:
9.0.301 [C:\Program Files\dotnet\sdk]
10.0.100-preview.5.25277.114 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-preview.5.25277.114 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-preview.5.25277.114 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-preview.5.25277.114 [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:
Not set

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.9.0 ms-azuretools.azure-dev-0.9.0
codespaces GitHub 1.17.3 github.codespaces-1.17.3
copilot GitHub 1.338.0 github.copilot-1.338.0
copilot-chat GitHub 0.28.3 github.copilot-chat-0.28.3
csharp ms-dotnettools 2.80.16 ms-dotnettools.csharp-2.80.16-win32-x64
debugpy ms-python 2025.8.0 ms-python.debugpy-2025.8.0-win32-x64
docker docker 0.11.0 docker.docker-0.11.0-win32-x64
esbuild-problem-matchers connor4312 0.0.3 connor4312.esbuild-problem-matchers-0.0.3
extension-test-runner ms-vscode 0.0.12 ms-vscode.extension-test-runner-0.0.12
memento-explorer bwater 0.1.5 bwater.memento-explorer-0.1.5
python ms-python 2025.8.0 ms-python.python-2025.8.0-win32-x64
remote-containers ms-vscode-remote 0.417.0 ms-vscode-remote.remote-containers-0.417.0
remote-explorer ms-vscode 0.5.0 ms-vscode.remote-explorer-0.5.0
remote-repositories ms-vscode 0.42.0 ms-vscode.remote-repositories-0.42.0
remote-server ms-vscode 1.5.2 ms-vscode.remote-server-1.5.2
remote-ssh ms-vscode-remote 0.120.0 ms-vscode-remote.remote-ssh-0.120.0
remote-ssh-edit ms-vscode-remote 0.87.0 ms-vscode-remote.remote-ssh-edit-0.87.0
remote-wsl ms-vscode-remote 0.99.0 ms-vscode-remote.remote-wsl-0.99.0
tsl-problem-matcher amodio 0.6.2 amodio.tsl-problem-matcher-0.6.2
vscode-azureresourcegroups ms-azuretools 0.10.13 ms-azuretools.vscode-azureresourcegroups-0.10.13
vscode-containers ms-azuretools 2.0.4-alpha vscode-containers
vscode-dotnet-runtime ms-dotnettools 2.3.6 ms-dotnettools.vscode-dotnet-runtime-2.3.6
vscode-eslint dbaeumer 3.0.10 dbaeumer.vscode-eslint-3.0.10
vscode-pylance ms-python 2025.6.2 ms-python.vscode-pylance-2025.6.2
vscode-remote-extensionpack ms-vscode-remote 0.26.0 ms-vscode-remote.vscode-remote-extensionpack-0.26.0
vscode-yaml redhat 1.18.0 redhat.vscode-yaml-1.18.0

Extension version: 2.80.16
VS Code version: Code 1.101.2 (2901c5ac6db8a986a5666c3af51ff804d05af0d4, 2025-06-24T20:27:15.391Z)
OS version: Windows_NT x64 10.0.26100
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz (20 x 3696)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 126.84GB (93.30GB free)
Process Argv --folder-uri file:///d%3A/vscode-containers --log ms-azuretools.vscode-containers=debug --crash-reporter-id c08aabd7-db54-41cf-8677-dacd1ad47381
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
pythonpulldiag:31335739
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
6518g693:31334701
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixt:31329274
j6a0c355:31337570
convertlamdaf:31329270
91889449:31332227
d7aab740:31337162
usemarketplace:31336439
nesew2to5:31336538
agentclaude:31335814
nes-diff-11:31337487
testaa123cf:31335227
6abeh943:31336334
yijiwantestdri0626-c:31336931
nes-varabove-1:31337528

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions