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

Open Solution fails in folder that has multiple solution files with project locations in different location #776

Open
williambuchanan2 opened this issue Dec 1, 2023 · 18 comments
Labels
area-solution Solution explorer mac MacOS

Comments

@williambuchanan2
Copy link

williambuchanan2 commented Dec 1, 2023

Type: Bug

If there is more than 1 solution file in a folder, when I do Open Folder nothing happens.

I know I am supposed to see a popup, but I see nothing.

Incidentally - if I uninstall the C# Dev Kit and .NET Maui extensions then the popup starts to show again (but then nothing happens when I select a solution).

Extension version: 0.5.50
VS Code version: Code 1.84.2 (Universal) (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:52:33.687Z)
OS version: Darwin arm64 23.1.0
Modes:

System Info
Item Value
CPUs Apple M2 Pro (12 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 1, 2, 2
Memory (System) 16.00GB (2.39GB free)
Process Argv --crash-reporter-id b9566a76-2b0f-495e-a772-549d05ca4538
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30899288
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
3biah626:30602489
f6dab269:30613381
vscrp:30673768
showlangstatbar:30737416
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialog:30887143
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30902429
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
dsvsc019:30909684

@timheuer
Copy link
Member

timheuer commented Dec 9, 2023

@williambuchanan2 Have you used the "Open Solution" command from the command palette which would ask you which solution to open?

opensln.mp4

@timheuer timheuer added area-solution Solution explorer and removed area-restore labels Dec 9, 2023
@williambuchanan2
Copy link
Author

williambuchanan2 commented Dec 10, 2023

Not sure if I am missing something but it doesn't seem to work for me. As soon as I choose that command it just goes back to the search function. If I then choose 'Go to file' it just opens up the sln file contents in an editor window.

Screen.Recording.2023-12-11.at.9.52.46.am.mov

@timheuer
Copy link
Member

timheuer commented Dec 10, 2023

@williambuchanan2 I only see one solution in your workspace so it wouldn’t show anything (that’s a diff bug).

Are you expecting like a file…open experience? Commands in extensions operate on the workspace (the folder you have open). If you had multiple SLN files it would offer which one to open.

Maybe I’m misunderstanding your request? What are you trying to accomplish if you already have a workspace open?

@williambuchanan2
Copy link
Author

Below is a screen shot of my solutions. There are multiple solutions in this folder. If I try to open this folder nothing happens.
Screenshot 2023-12-11 at 10 14 53 am

@williambuchanan2
Copy link
Author

Screen.Recording.2023-12-11.at.10.53.43.am.mov

@williambuchanan2
Copy link
Author

See movie above. This is my understanding of how it should work... I do a File -> Open Folder - if that folder has multiple solutions I should be prompted to choose which solution I want to open.

As you can see from the movie that doesn't happen. Nothing happens other than all the solutions being listed in the explorer.

If I double click on a solution file, or do a file open on a solution file all that happens is the contents of the solution load in an editor.

Maybe I am over thinking this, or missing something, but in my way of thinking I shouldn't need to know some hidden trick to open a solution. Why can't I just open a solution file the same way I do in VS?

So am I missing something, or is it just that it doesn't work?

@timheuer timheuer added the mac MacOS label Dec 11, 2023
@timheuer
Copy link
Member

Ok thanks @williambuchanan2 the prior screen cap threw me off as there was only one in the workspace. Now I think I understand your setup...

You have a folder that has just .SLN files and that's how you manage different solutions. They are not next to the projects, but likely have relative path mapping in the SLN files to the projects. I just tried this setup myself and was able to see it. I'm not sure if this is a macOS vs. Windows thing (didn't see anything obvious why it would), but I understand your setup now.

When you open the "Open Solution" command if you wait a bit is it offering the list (can't imagine it would take more than 1s to enumerate your directory, but just checking).

slnopen.mp4

Why can't I just open a solution file the same way I do in VS?

With regard to this, the short answer is that VS code is different. It's an editor first so double-clicking a SLN file is just going to open that file. There isn't similar mechanisms were .sln is registered in a way like VS as a file handler, open in an IDE that is targeted to default-open SLN as a project, etc. "open file in editor" is kind of the default action for all files in VSCode.

@timheuer timheuer changed the title Multiple solution folders Open Solution fails in folder that has multiple solution files with project locations in different location Dec 11, 2023
@timheuer timheuer added the area-project Project load, Solution Explorer label Dec 11, 2023
@timheuer
Copy link
Member

/cc @webreidi might be a mac-specific issue to validate

@williambuchanan2
Copy link
Author

@timheuer Yes this is how my workspace is setup. Sorry - I forgot there was a random sln file in the first screen shot - this added to the confusion!

I tried waiting but the option to select the solution didn't appear.

@webreidi
Copy link
Collaborator

I was able to recreate this on both the Mac and Windows. If there isn't a .csproj file in the folder, C# Dev Kit is not activating.

@timheuer
Copy link
Member

I was able to recreate this on both the Mac and Windows. If there isn't a .csproj file in the folder, C# Dev Kit is not activating.

Yikes, okay -- not my experience (see video), but at least you have a repro. /cc @kvenkatrajan

@smitpatel
Copy link
Member

If there isn't a .csproj file in the folder, C# Dev Kit is not activating.

This has been behavior since start of the extension. We have few other activation triggers but sln file is not one of them. There are also some restrictions if the project folders are not in the open workspace in terms of watching and modifying them.

@tmeschter tmeschter removed the area-project Project load, Solution Explorer label Dec 14, 2023
@tmeschter
Copy link
Member

Removing "area-project" as this is a solution loading issue.

Copy link

github-actions bot commented Apr 3, 2024

This issue has been marked as stale after 14 days of inactivity. @[ @ @], could you please take a look?

@webreidi
Copy link
Collaborator

webreidi commented Apr 4, 2024

@williambuchanan2 were you able to use the ".NET: Open Solution" command to get your solution to open? Please reopen this issue if that did not work for you.

@webreidi webreidi closed this as completed Apr 4, 2024
@williambuchanan2
Copy link
Author

williambuchanan2 commented Apr 9, 2024

@williambuchanan2 were you able to use the ".NET: Open Solution" command to get your solution to open? Please reopen this issue if that did not work for you.

@webreidi
Not sure why you closed this. Nothing has changed - presumably because nobody has looked at the problem... Shouldn't someone put a fix in place before closing open items?

@webreidi
Copy link
Collaborator

@williambuchanan2 I apologize, but when we ask a question and get no response from the submitter, we assume that everything is working and close the ticket. To help us troubleshoot further, can you answer the question asked, please?

@williambuchanan2 were you able to use the ".NET: Open Solution" command to get your solution to open? Please reopen this issue if that did not work for you.

@webreidi webreidi reopened this Apr 15, 2024
@williambuchanan2
Copy link
Author

@williambuchanan2 I apologize, but when we ask a question and get no response from the submitter, we assume that everything is working and close the ticket. To help us troubleshoot further, can you answer the question asked, please?

@williambuchanan2 were you able to use the ".NET: Open Solution" command to get your solution to open? Please reopen this issue if that did not work for you.

Ok, but you asked the question and closed the bug at the exact same time... The problem still exists. Using .NET Open solution does nothing, as per the screen recording above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-solution Solution explorer mac MacOS
Projects
None yet
Development

No branches or pull requests

5 participants