vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Run and Debug doesn't populate with projects

Open clarity99 opened this issue 2 years ago • 7 comments

Type: Bug

Issue Description

I have a solution with a few projects - 2 console, 2 libraries, 2 asp.net core mvc apps. In Run and Debug I only see one console app, nothing else. I tried: Generate Assets for Run and Debug, and it asks me to regenerate them and properly shows the possible projects and after I select one which should be main, nothing happens. In the Solution Explorer I see all the projects and can run & debug them.

Steps to Reproduce

Expected Behavior

Run and Debug should have the same projects to run as Solution Explorer

Actual Behavior

Only one project shows up.

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

Environment information

VSCode version: 1.81.1 C# Extension: 2.0.436 Using OmniSharp: false

Dotnet Information .NET SDK: Version: 7.0.304 Commit: 7e794e2806

Runtime Environment: OS Name: Mac OS X OS Version: 13.5 OS Platform: Darwin RID: osx.13-arm64 Base Path: /usr/local/share/dotnet/sdk/7.0.304/

Host: Version: 7.0.7 Architecture: arm64 Commit: 5b20af47d9

.NET SDKs installed: 6.0.101 [/usr/local/share/dotnet/sdk] 6.0.202 [/usr/local/share/dotnet/sdk] 6.0.301 [/usr/local/share/dotnet/sdk] 6.0.400 [/usr/local/share/dotnet/sdk] 6.0.404 [/usr/local/share/dotnet/sdk] 6.0.408 [/usr/local/share/dotnet/sdk] 6.0.410 [/usr/local/share/dotnet/sdk] 7.0.100 [/usr/local/share/dotnet/sdk] 7.0.101 [/usr/local/share/dotnet/sdk] 7.0.302 [/usr/local/share/dotnet/sdk] 7.0.304 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found: x64 [/usr/local/share/dotnet/x64]

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
chatgpt-vscode genieai 0.0.8 genieai.chatgpt-vscode-0.0.8
cortex-debug marus25 1.12.0 marus25.cortex-debug-1.12.0
cpptools ms-vscode 1.17.5 ms-vscode.cpptools-1.17.5-darwin-arm64
csdevkit ms-dotnettools 0.4.10 ms-dotnettools.csdevkit-0.4.10-darwin-arm64
csharp ms-dotnettools 2.0.436 ms-dotnettools.csharp-2.0.436-darwin-arm64
debug-tracker-vscode mcu-debug 0.0.15 mcu-debug.debug-tracker-vscode-0.0.15
dotnet-interactive-vscode ms-dotnettools 1.0.4403010 ms-dotnettools.dotnet-interactive-vscode-1.0.4403010
dscodegpt DanielSanMedium 2.1.16 danielsanmedium.dscodegpt-2.1.16
errorlens usernamehw 3.13.0 usernamehw.errorlens-3.13.0
git-graph mhutchie 1.30.0 mhutchie.git-graph-1.30.0
gitlens eamodio 14.2.1 eamodio.gitlens-14.2.1
jupyter ms-toolsai 2023.7.1002162226 ms-toolsai.jupyter-2023.7.1002162226-darwin-arm64
jupyter-keymap ms-toolsai 1.1.2 ms-toolsai.jupyter-keymap-1.1.2
jupyter-renderers ms-toolsai 1.0.17 ms-toolsai.jupyter-renderers-1.0.17
linqpad2dnn ambroseleung 0.0.2 ambroseleung.linqpad2dnn-0.0.2
memory-view mcu-debug 0.0.23 mcu-debug.memory-view-0.0.23
particle-vscode-core particle 1.16.7 particle.particle-vscode-core-1.16.7
particle-vscode-pack particle 1.16.7 particle.particle-vscode-pack-1.16.7
particle-vscode-snippets particle 1.16.7 particle.particle-vscode-snippets-1.16.7
particle-vscode-theme particle 1.16.7 particle.particle-vscode-theme-1.16.7
peripheral-viewer mcu-debug 1.4.6 mcu-debug.peripheral-viewer-1.4.6
python ms-python 2023.14.0 ms-python.python-2023.14.0
rtos-views mcu-debug 0.0.7 mcu-debug.rtos-views-0.0.7
vscode-dotnet-pack ms-dotnettools 1.0.12 ms-dotnettools.vscode-dotnet-pack-1.0.12
vscode-dotnet-runtime ms-dotnettools 1.7.2 ms-dotnettools.vscode-dotnet-runtime-1.7.2
vscode-dotnet-watch Murugaratham 1.1.8 murugaratham.vscode-dotnet-watch-1.1.8
vscode-github-actions github 0.26.1 github.vscode-github-actions-0.26.1
vscode-jupyter-cell-tags ms-toolsai 0.1.8 ms-toolsai.vscode-jupyter-cell-tags-0.1.8
vscode-jupyter-powertoys ms-toolsai 0.0.8 ms-toolsai.vscode-jupyter-powertoys-0.0.8
vscode-jupyter-slideshow ms-toolsai 0.1.5 ms-toolsai.vscode-jupyter-slideshow-0.1.5
vscode-pull-request-github GitHub 0.70.0 github.vscode-pull-request-github-0.70.0
vscodeintellicode-csharp ms-dotnettools 0.1.26 ms-dotnettools.vscodeintellicode-csharp-0.1.26-darwin-arm64

Extension version: 2.0.436 VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:40:25.698Z) OS version: Darwin arm64 22.6.0 Modes:

System Info
Item Value
CPUs Apple M1 (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 32, 18, 10
Memory (System) 8.00GB (0.13GB free)
Process Argv --crash-reporter-id 0534f649-86d4-49d4-b313-296d31bf8153
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30803844
3biah626:30602489
f6dab269:30613381
2i9eh265:30646982
showlangstatbar:30737416
962ge761:30823813
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofb:30804716
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
asynctok:30821568
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572

clarity99 avatar Aug 31 '23 07:08 clarity99

@clarity99 Would these projects happen to be in folder above/other than where the current vscode folder is opened?

WardenGnaw avatar Sep 01 '23 22:09 WardenGnaw

@clarity99 Would these projects happen to be in folder above/other than where the current vscode folder is opened?

No. Top level folder is open. I've now deleted launch.json in top level .vscode folder and rerun Generate Assets for Run and Debug and now it recreated the file, with just the one project to run that I selected when running. I guess that's better than nothing, but to me it would still make sense to have all the projects available, if it is able to detect them in solution explorer.

clarity99 avatar Sep 04 '23 09:09 clarity99

Is the issue that Generate Assets for Run and Debug will show all the projects but hitting Run and Debug will only show one console project?

WardenGnaw avatar Sep 05 '23 19:09 WardenGnaw

Solution explorer shows all projects, Generate Assets for Run and Debug shows some of them, and Run and Debug only one.

On 5 Sep 2023 at 21:57:57, Andrew Wang @.***> wrote:

Is the issue that Generate Assets for Run and Debug will show all the projects but hitting Run and Debug will only show one console project?

— Reply to this email directly, view it on GitHub https://github.com/dotnet/vscode-csharp/issues/6259#issuecomment-1707230380, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA6DQMVC5XT2AEJLC2CKJLXY574LANCNFSM6AAAAAA4FTSPZY . You are receiving this because you were mentioned.Message ID: @.***>

clarity99 avatar Sep 05 '23 20:09 clarity99

Generate Assets for Run and Debug shows some of them

@dibarbet Any ideas why the Generate Assets for Run and Debug is dropping some projects?

Run and Debug only one.

@tmeschter Any ideas why we are missing some projects from being listed?

WardenGnaw avatar Sep 05 '23 22:09 WardenGnaw

@dibarbet Any ideas why the Generate Assets for Run and Debug is dropping some projects?

Generate assets will only generate 'runnable' projects, so the console projects and potentially the mvc ones.

@clarity99 is the project in run and debug the one you selected to generate?

dibarbet avatar Sep 05 '23 22:09 dibarbet

@dibarbet after deleting launch.json now the run and debug shows the one project I selected to generate yes. if i select another web project it replaces the one from before. however, console project is added, so I have now two projects in run and debug - web and console. it's weird.

clarity99 avatar Sep 17 '23 18:09 clarity99