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
227 stars 11 forks source link

Solution explorer is unable to load a netstandard2.0 project #178

Closed kblok closed 1 year ago

kblok commented 1 year ago

Type: Bug

The solution explorer says that "A compatible .NET SDK was not found" but if I click "Build solution" it is able to build a solution. I also get a "Projects: x 8" error at the bottom with no clear explanation from there.

image

Extension version: 0.1.103 VS Code version: Code 1.79.2 (695af097c7bd098fbf017ce3ac85e09bbc5dda06, 2023-06-14T08:58:33.551Z) OS version: Darwin arm64 22.5.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
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)|71, 26, 23| |Memory (System)|16.00GB (0.19GB free)| |Process Argv|--crash-reporter-id 309bc9cc-116f-41cd-ab5a-2167d02c49a3| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931:30280409 vshan820:30294714 vstes263cf:30335440 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 282f8724:30602487 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 a2ce3375:30757347 pythonfmttext:30731395 pythoncmv:30756943 fixshowwlkth:30771522 pythongtdpath:30769146 dh2dc718:30770000 pythonnocebcf:30771284 ```
timheuer commented 1 year ago

@kblok this is working for me. Can you add output of your dotnet --info?

image

kblok commented 1 year ago

@timheuer sure! For the record. My main IDE is VS For Mac, and it's working as expected.

.NET SDK:
 Version:   7.0.100
 Commit:    e12b7af219

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  13.4
 OS Platform: Darwin
 RID:         osx.13-arm64
 Base Path:   /opt/homebrew/Cellar/dotnet/7.0.100/libexec/sdk/7.0.100/

Host:
  Version:      7.0.0
  Architecture: arm64
  Commit:       d099f075e4

.NET SDKs installed:
  7.0.100 [/opt/homebrew/Cellar/dotnet/7.0.100/libexec/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.0 [/opt/homebrew/Cellar/dotnet/7.0.100/libexec/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.0 [/opt/homebrew/Cellar/dotnet/7.0.100/libexec/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]
    registered at [/etc/dotnet/install_location_x64]

Environment variables:
  DOTNET_ROOT       [/opt/homebrew/Cellar/dotnet/7.0.100/libexec]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
timheuer commented 1 year ago

Ok, will have to see if someone on the team can repro in this environment (can't imagine it would be arm-specific). Just tried on my mac as well and I can see it fine. Another you can try to confirm it is not just yours is https://github.com/timheuer/alexa-skills-dotnet

kblok commented 1 year ago

I'm getting the same on that repo :/

timheuer commented 1 year ago

Thanks for confirming -- will get it assigned.

tmeschter commented 1 year ago

Hi @kblok, I have some follow-up questions for you:

  1. Are you still experiencing this issue?
  2. If so, would you be willing to try removing the Homebrew installation of the SDK and installing the latest .NET 7.0 SDK (currently 7.0.400) from https://dotnet.microsoft.com/en-us/download/dotnet/7.0? We've had other reports of issues with the Homebrew install (discussed in #120 among others).
kblok commented 1 year ago

Removing dotnet from brew worked! Thank you!

tmeschter commented 1 year ago

To fully close the loop on this, there are a couple of things that may be going on:

  1. The version of the .NET SDK installed by Homebrew is too old. In this case 7.0.100 was installed, but C# Dev Kit really wants 7.0.203 or newer. However, I wouldn't expect the project to be completely broken by this, and I haven't seen the "A compatible .NET SDK was not found" message resulting from this.
  2. C# Dev Kit (or some part of it) is not able to locate the SDK at the path used by Homebrew. This seems a more likely explanation to me, and improving the detection of SDKs (however they are installed) is something we are working on.

@kblok I'm glad this is working for you now. If this behavior happens again please open a new issue. Thank you!