microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
226 stars 11 forks source link

Solution explorer does not appear when existing folder with .sln is open #1133

Closed ibobak closed 2 months ago

ibobak commented 4 months ago

Type: Bug

I have a previously created and fully working solution (made in Jetbrains Rider) with several projects.
Now I have VS code, I installed C# Dev Kit and I want to manage my solution with it.
But solution explorer is not appearing:

image image image image

Extension version: 1.5.20 VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:16:23.416Z) OS version: Linux x64 6.4.6-060406-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 3700X 8-Core Processor (16 x 4209)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|46.95GB (27.46GB free)| |Process Argv|--crash-reporter-id d91c5c25-2c49-4af3-80cb-302636dde5af| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 tftest:31042121 vswsl492cf:30256860 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 chatpanelt:31048053 dsvsc021:30996838 9c06g630:31013171 pythoncenvptcf:31049071 a69g1124:31046351 dvdeprecationcf:31052040 pythonprc:31047982 dwnewjupyter:31046869 26j00206:31048877 ```
ibobak commented 4 months ago

image

ibobak commented 4 months ago

I closed my test solution, and then opened a folder - it opens it fine and solution appears.

This is the contents of the newly created solution with a console project:


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{A696C075-05FE-4389-93D2-2E6C551DB49B}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {A696C075-05FE-4389-93D2-2E6C551DB49B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {A696C075-05FE-4389-93D2-2E6C551DB49B}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {A696C075-05FE-4389-93D2-2E6C551DB49B}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {A696C075-05FE-4389-93D2-2E6C551DB49B}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
EndGlobal

And this is the contents of my previous solution file (made by Jetbrains Rider):


Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RMMLLib", "RMMLLib\RMMLLib.csproj", "{030804EB-13B4-42A1-9C2A-CF7EA0BC6FAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTesting", "IntegrationTesting\IntegrationTesting.csproj", "{B4967D61-B9C5-4668-9B30-4C11C7354FF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RMMLCallerExample", "RMMLCallerExample\RMMLCallerExample.csproj", "{93D668C1-2632-48F3-A94C-DC4027F7FBE2}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {030804EB-13B4-42A1-9C2A-CF7EA0BC6FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {030804EB-13B4-42A1-9C2A-CF7EA0BC6FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {030804EB-13B4-42A1-9C2A-CF7EA0BC6FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {030804EB-13B4-42A1-9C2A-CF7EA0BC6FAD}.Release|Any CPU.Build.0 = Release|Any CPU
        {B4967D61-B9C5-4668-9B30-4C11C7354FF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {B4967D61-B9C5-4668-9B30-4C11C7354FF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {B4967D61-B9C5-4668-9B30-4C11C7354FF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {B4967D61-B9C5-4668-9B30-4C11C7354FF7}.Release|Any CPU.Build.0 = Release|Any CPU
        {93D668C1-2632-48F3-A94C-DC4027F7FBE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {93D668C1-2632-48F3-A94C-DC4027F7FBE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {93D668C1-2632-48F3-A94C-DC4027F7FBE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {93D668C1-2632-48F3-A94C-DC4027F7FBE2}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
EndGlobal

I see some differences. But the question is: what might be wrong?

ibobak commented 4 months ago

If some additional info is needed from me - just let me know. This bug is critical: I can't open my existing projects.

nagilson commented 4 months ago

cc @tmeschter for this issue

mwkcoding commented 3 months ago

I too am having this problem with a bigger solution originally created in Visual Studio a long time ago.

richardstanton commented 3 months ago

Looking at your solution file, it appears to be valid. I was able to make a copy and open it in C# DevKit. It doesn't have some of the optional property values like MinimumVisualStudioVersion, but that shouldn't prevent it from loading. The solution explorer doesn't display if the workspace doesn't contain any .csproj files. Since the solution contains references to several .csproj files, it seems like that wouldn't be the case, but just confirming that the workspace does contain .csproj files? C# DevKit may not open a solution if it finds multiple solution files, in which case it should prompt to pick one.

Can you manually open the solution using the command palette command: ".NET: Open Solution"? If so, making a simple change to the solution like adding and removing a solution folder would resave the solution file.

ibobak commented 2 months ago

it works for me now, no matter how I open it: using "open a folder containing .net solution" or using ".NET: Open Solution".

github-actions[bot] commented 2 months ago

@Michael-Eng, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.