dotnet / dotnet/vscode-csharp

Kindly document in a prominent place that a sln-file is needed for much of the functionality to work

Open
#7,683 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

## Is your feature request related to a problem? Please describe.

For several hours, I could not get intellisense working in the C# extension, and there was no helpful setting or error message to the rescue. By pure chance, and after hours of googling, I found that a sln-file may help. After using `dotnet new sln` and `dotnet sln add ...path/to/all/relevant/csproj`, intellisense started working!!!

My setup is so that I have a project that uses mostly `csproj` files, but also two or three dedicated `sln` files buried in subdirectories. One of these sln-files is exclusively used in CI tests. It points to a sub-project, that is not meant to be built or used in VSCode. This sub-project only works correctly (i.e. can only do a `nutget restore`) when used inside of our CI system.

I think this additional sln-file may be related to the problem I was having. This is because I'm under the impression that the C# extension tried to load one or more of the sln-files in subdirectories and then failed to correctly index my project(?)

## Describe the solution you would like

It would be great if this could be better documented on the front page of the C# extension. Possibly, there could also be better error or logging messages?. I'm not sure which of the following two applies:
- A sln-file linking all the csproj-files is mandatory?
- No non-working sln-files in subdirectories should exist?

## Applicable Scenarios

## Describe alternatives you've considered

## Additional context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.