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

Can no longer target a directory containing subdirectories with csproj files #4691

Closed
wuzzeb opened this issue Jul 29, 2021 · 11 comments · Fixed by #4695
Closed

Can no longer target a directory containing subdirectories with csproj files #4691

wuzzeb opened this issue Jul 29, 2021 · 11 comments · Fixed by #4695

Comments

@wuzzeb
Copy link

wuzzeb commented Jul 29, 2021

In this commit on line 181, the ability to open a directory in which many subdirectories contained csproj files was removed.

369a904#diff-c297262b72ad1ea22e80c49f21777b21eeab88e2c535f0286a387c392f85c91cL181

The logic was if ((hasCsProjFiles && !hasSlnFile) || (hasProjectJson && !hasProjectJsonAtRoot)) but now it is gone completely. This is exactly the condition in my project: no sln file anywhere, no project.json anywhere, and the root directory opened in vscode has a bunch of subdirectories, each of which contain csproj files.

What was the reason to remove the (hasCsProjFiles && !hasSlnFile) check to add a directory target?

I re-added the check in wuzzeb@00894e1 and it works perfectly for me.

Should I submit a pull-request? I am somewhat hesitant to submit a pull request because the check was deliberately deleted. Was there a reason to remove this development mode?

@JoeRobich
Copy link
Member

JoeRobich commented Jul 29, 2021

@wuzzeb Sorry we broke your scenario. We were trying to make working with projects easier by adding them to the Project Select (command "OmniSharp: Select Project"). Please open a PR and we will review and get it in.

Also, are you using the "Load projects on demand" feature?

@lonix1
Copy link

lonix1 commented Jul 30, 2021

Will this only be fixed in the next vscode update a month from now?

It "broke" vscode for us. Don't know what to do other than roll back and that always leads to problems with mono.

Any advice appreciated

@lonix1
Copy link

lonix1 commented Aug 3, 2021

Hi again @JoeRobich is this bug on the roadmap? It landed just a few days ago, that's why I'm pushing - whereas a while from now it'll just be another issue on the backlog.

So my question is, is this on the todo list for the next update / hotfix?

Hate to sound like a broken record but it's a nasty one. Working on big projects is insanely difficult right now.

@JoeRobich
Copy link
Member

Please try this prerelease https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.15-beta1

@alexrp
Copy link

alexrp commented Aug 4, 2021

I can confirm that the above pre-release fixes the issue for me.

@Sour-Codes
Copy link

Also confirming the pre-release is exactly what I needed. After six days of wondering why my projects weren't loading, I gave up and searched for this. I support this thread. Please make this an option. I think the lack of a *.sln should imply that I want everything loaded.

@lonix1
Copy link

lonix1 commented Aug 5, 2021

I think the lack of a *.sln should imply that I want everything loaded.

Agreed. The original behavior should be restored to alleviate our suffering.


Side note, to consider after this issue is fixed:

Since being forced to use that little dropdown to switch between projects, I noticed something unexpectedly positive. The IDE is snappier because not everything is loaded. It would be nice to have a new option where we can tick multiple projects (instead of just one) in that dropdown, to load just those projects we need. Then I wouldn't load projects that I rarely touch - instant perf improvement.

@Sour-Codes
Copy link

Not sure how much alteration one can do to the explorer window as I never tried building for an IDE; however, adding onto what @lonix1 is suggesting, a tick box next to the paths that it detects with project files is a better approach to "...make working with projects easier."

Using below as an example. This path has over 40 projects with a dependency to one. I might decide now to work on one sensor...get bored...work on another...get bored...see a delivery arrived with more sensors...work on that...get bored, go back to the first.... Intellisense worked perfectly until .... well, we all already know what happened...

image

(Also, don't forget a select/deselect all if going with this approach otherwise we're all back in another thread wishing things were as simple as the old ways...)

Until a few days ago, this was a mindless process for years. Having to select which project I want to work on makes me think "well, why not just install bloated Visual Studio that forces a *.sln file anyway and work with that as in the very least, it'll automatically add new projects into the *.sln file without me having to pick..."

Not knocking ya -- I 🖤 Omnisharp and it was the sole reason I got rid of Visual Studio years ago for its simplicity that you don't get using VS. I'm just a bit triggered with this *.sln dependency approach.

@lonix1
Copy link

lonix1 commented Aug 6, 2021

As I recall Visual Studio has support for specifying which projects to load, so it's not all or nothing. However it's not an easy process, there's dialog boxes, and dependency checks, and whatnot.

So the same idea in VSCode - some day after this fix is released, let's not lose sight of the main goal - would be very much appreciated. (@JoeRobich would you like for me to open a new feature request issue?)

The two ideas are: multiple ticks in the project selector dropdown (my preference), and ticks next to projects in the explorer pane (@Sour-Codes' preference).

@Banyc
Copy link

Banyc commented Sep 3, 2021

@wuzzeb Sorry we broke your scenario. We were trying to make working with projects easier by adding them to the Project Select (command "OmniSharp: Select Project"). Please open a PR and we will review and get it in.

Also, are you using the "Load projects on demand" feature?

@JoeRobich I was obstructed by the same issue until I found this issue. I wish for an explicit instruction on this mechanism. It could also highlight projects letting people know which projects are targeted. Otherwise, new comers might consider it as a bug and feel frustrated. But once people have learned it in advance, this mechanism will be a good way to enhance their experience! Thanks for your hard work as usual!

@carlin-q-scott
Copy link

Why is this issue open? It looks like it was supposed to be fixed two years ago, but I'm seeing the issue with the latest release of the extension and VS Code. My workspace has two sln files in the root, and a dozen csproj files in subdirectories. The extension documentation seems to say that it only supports a sln in the workspace root if there's also a csproj in the root. Am I understanding that correctly?

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants