Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dev Kit Not Working Properly With multiple projects in folders #651

Closed
dibarbet opened this issue Oct 25, 2023 · 7 comments
Closed
Labels
area-solution Solution explorer bug Something isn't working needs-more-info Needing more information, waiting on OP

Comments

@dibarbet
Copy link
Member

Describe the Issue

Copied from dotnet/vscode-csharp#6596, originally filed by @thndgonz

Issue Description

I have multiple .csproj in a workspace. When I first installed Dev Kit it seems to have processed only one folder in which it added a SLN file.

The language server starts failing with the other folders.

Steps to Reproduce

Not sure if it matters (as in OS oriented)
Have ubuntu/any other distro.
Open Visual Studio Code
Add several project folders with their respective csproj file to your workspace (do not add any project with a SLN, for reproduction purposes)
Install C# Dev Kit.
Notice that Dev Kit will add only one SLN.
Notice that the syntax highlighting and autocomplete starts failing when you switch over to different *.cs files in the editor.

Expected Behavior

Dev Kit or the language server doesn't "choke" when each csproj doesn't have a SLN. Autocomplete and syntax highlighting works.

Actual Behavior

Dev Kit enabled and/or SLN existing in a folder causes a lot of heartburns for the language server apparently. Disabling syntax highlighting and autocomplete.

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.83.1
C# Extension: 2.7.25
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 7.0.113 Commit: e24ee34c8e

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/7.0.113/

Host:
Version: 7.0.13
Architecture: x64
Commit: 3f73a2f186

.NET SDKs installed:
7.0.113 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/usr/share/dotnet]

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
blazorwasm-companion ms-dotnettools 1.1.4 ms-dotnettools.blazorwasm-companion-1.1.4
codesnap adpyke 1.3.4 adpyke.codesnap-1.3.4
csharp ms-dotnettools 2.7.25 ms-dotnettools.csharp-2.7.25-linux-x64
es7-react-js-snippets dsznajder 4.4.3 dsznajder.es7-react-js-snippets-4.4.3
gulptasks nickdodd79 1.3.1 nickdodd79.gulptasks-1.3.1
html-entities christopherstyles 1.1.2 christopherstyles.html-entities-1.1.2
isort ms-python 2023.10.1 ms-python.isort-2023.10.1
lipsum-generator MrAwesomeRocks 1.2.3 mrawesomerocks.lipsum-generator-1.2.3
mysql-syntax jakebathman 1.3.1 jakebathman.mysql-syntax-1.3.1
nginx-formatter raynigon 0.0.13 raynigon.nginx-formatter-0.0.13
npm-intellisense christian-kohler 1.4.5 christian-kohler.npm-intellisense-1.4.5
path-intellisense christian-kohler 2.8.5 christian-kohler.path-intellisense-2.8.5
php-debug xdebug 1.33.1 xdebug.php-debug-1.33.1
powershell ms-vscode 2023.8.0 ms-vscode.powershell-2023.8.0
python ms-python 2023.18.0 ms-python.python-2023.18.0
remote-containers ms-vscode-remote 0.315.1 ms-vscode-remote.remote-containers-0.315.1
remote-ssh ms-vscode-remote 0.106.5 ms-vscode-remote.remote-ssh-0.106.5
remote-ssh-edit ms-vscode-remote 0.86.0 ms-vscode-remote.remote-ssh-edit-0.86.0
remote-wsl ms-vscode-remote 0.81.8 ms-vscode-remote.remote-wsl-0.81.8
remove-tabs-on-save redlin 1.2.4 redlin.remove-tabs-on-save-1.2.4
tailwind-docs austenc 2.1.0 austenc.tailwind-docs-2.1.0
tailwindshades bourhaouta 0.0.5 bourhaouta.tailwindshades-0.0.5
vim vscodevim 1.26.2 vscodevim.vim-1.26.2
vscode-docker ms-azuretools 1.27.0 ms-azuretools.vscode-docker-1.27.0
vscode-dotnet-runtime ms-dotnettools 1.8.1 ms-dotnettools.vscode-dotnet-runtime-1.8.1
vscode-edge-devtools ms-edgedevtools 2.1.3 ms-edgedevtools.vscode-edge-devtools-2.1.3
vscode-eslint dbaeumer 2.4.2 dbaeumer.vscode-eslint-2.4.2
vscode-gulp tanato 0.0.4 tanato.vscode-gulp-0.0.4
vscode-intelephense-client bmewburn 1.9.5 bmewburn.vscode-intelephense-client-1.9.5
vscode-mysql formulahendry 0.5.0 formulahendry.vscode-mysql-0.5.0
vscode-nginx-conf ahmadalli 0.3.2 ahmadalli.vscode-nginx-conf-0.3.2
vscode-pylance ms-python 2023.10.40 ms-python.vscode-pylance-2023.10.40
vscode-react-native msjsdiag 1.12.1 msjsdiag.vscode-react-native-1.12.1
vscode-sql-formatter adpyke 1.4.4 adpyke.vscode-sql-formatter-1.4.4
vscode-tailwindcss bradlc 0.10.1 bradlc.vscode-tailwindcss-0.10.1
vscode-todo-highlight wayou 1.0.5 wayou.vscode-todo-highlight-1.0.5
vscode-xml redhat 0.26.1 redhat.vscode-xml-0.26.1-linux-x64
vscode-yaml redhat 1.14.0 redhat.vscode-yaml-1.14.0

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

No response

@tmeschter
Copy link
Member

@thndgonz Just so I'm clear on how to reproduce this, your workspace contains multiple top-level folders rather than just one?

@tmeschter tmeschter added needs-more-info Needing more information, waiting on OP area-solution Solution explorer and removed area-project Project load, Solution Explorer labels Oct 26, 2023
@gwtdgonz
Copy link

@thndgonz Just so I'm clear on how to reproduce this, your workspace contains multiple top-level folders rather than just one?

Yes, each project is at top level (example to clear any doubts):

  • Workspace (root folder)
    • Project 1
      • .csproj file
    • Project 2
      • .csproj file
    • Project 3...etc
      • .csproj file

In terms of my file system:
/opt/projects (root folder)

  • Project 1
  • Project 2
  • Project 3
  • and so on

@rocifier
Copy link

Same problem here, multiple C# solutions as described above are not supported

@thndgonz
Copy link

Same problem here, multiple C# solutions as described above are not supported

Yesterday I had to set up vscode on a new computer and noticed that syntax highlighting and code completion were working as expected. This led me to believe that the reason it broke is perhaps a cache/old files (configs?) issues.

Granted there was also a new step. I let Dev Kit create/have its way generating the SLN file as well and placed it in the parent folder and just removed the things I didn't need.

So what I did yesterday on my laptop where the issue appeared was just wipe the Code folder in ~/.config/Code (in my case) and it started working again.

Summary, whatever is triggering this bug has to do with old cached files or old configuration files.

Copy link

This issue has been automatically closed due to inactivity from original bug filer and having the 'needs-more-info' label for more than 14 days. If the issue still persists, please reopen the issue with the requested information.

@ck-pando
Copy link

Has anyone found a solution to this? I am seeing this issue on the latest version of dev kit. My file structure is:

Workspace (root folder)
-- Project 1
---- .csproj file
-- Project 2
---- .csproj file

@peterneave
Copy link

I've had issues with multiple solutions in the same directory. The work around is to run .NET: Open Solution in the command palette and Devkit works as expected. It would be great if we could have some configuration that allows us to specify the main solution that we want Devkit to open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-solution Solution explorer bug Something isn't working needs-more-info Needing more information, waiting on OP
Projects
None yet
Development

No branches or pull requests

7 participants