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] Solution explorer not showing #808

Open
vriesj opened this issue Dec 15, 2023 · 25 comments
Open

[BUG] Solution explorer not showing #808

vriesj opened this issue Dec 15, 2023 · 25 comments
Labels
area-solution Solution explorer bug Something isn't working

Comments

@vriesj
Copy link

vriesj commented Dec 15, 2023

Describe the Issue

Probably related to #704 (closed)

When opening the solution explorer the following error appears.
image

And the solution explorer will fail to open:
image

C# log output

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\e8f7761c"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 12:00:34 PM] [Program] Language server initialized

C# Dev Kit log output:

Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
Using preinstalled .NET runtime at "C:\Program Files\dotnet\dotnet.exe"
Using runtime installed in SDK.
.NET server started and IPC established in 1917ms
Completed Spawn .NET server (4392ms)
Completed Clear environment (4766ms)
Completed Open a solution with environment service (4811ms)
Starting Restore solution...
Completed Open a solution (4835ms)
Starting NuGet restore for the solution.
Starting command: "dotnet.exe" restore C:\src\mySolution.sln --interactive...
Failed to listen to project initialization status: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.ProjectInitializationStatusService (0.1)" service failed.
Completed command: "dotnet.exe" restore C:\src\mySolution.sln --interactive (3076ms)
Completed NuGet restore.
Completed Restore solution (3079ms)

C# Dev Kit - Text Explorer log output

Created Test Controller
unable to create test controller for c# extension: Error: Activating the "Microsoft.VisualStudio.TestWindow.VSCode.Service (0.1)" service failed.

The dotnet restore failing might be related to dotnet/sdk#10189 which I've resolved manually via dotnet/sdk#10189 (comment) this however did not fix the solution explorer.

PS C:\src> iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'))
PS C:\src> dotnet restore .\mySolution.sln --interactive
  Determining projects to restore...
  All projects are up-to-date for restore.
PS C:\src> 

Steps To Reproduce

No specific reproduction steps known other than a clean install.

Expected Behavior

No errors or UI bugs.

Environment Information

  • Windows 10 (22H2 19045.3693)

  • VS Code (in portable mode; data directory)
    image

  • System also runs Visual Studio 2022

  • dotnet sdk's

PS C:\src> dotnet --list-sdks
6.0.406 [C:\Program Files\dotnet\sdk]
7.0.200 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]
@vriesj vriesj added the bug Something isn't working label Dec 15, 2023
@microsoft-issue-labeler microsoft-issue-labeler bot added the area-solution Solution explorer label Dec 15, 2023
@timheuer
Copy link
Member

Thanks @vriesj can you tell me what version of the extension you have as well?

@imosan
Copy link

imosan commented Dec 16, 2023

@timheuer I'm having trouble with the same problem. these are the version of vscode extensions.

C# v2.14.8
C# Dev Kit v1.1.16

@lukewis
Copy link

lukewis commented Dec 16, 2023

Not sure if it's related, but in my case intellisense also does not work (maybe due to this issue)?

@timheuer
Copy link
Member

@imosan / @lukewis -- can you share any output you have from the "C#" and "C# Dev Kit" output logs within VSCode as well as dotnet --info outputs?

@imosan
Copy link

imosan commented Dec 18, 2023

@timheuer here is the output. Thanks.

Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[Error - 8:34:02 PM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Timeout. Named pipe information not received from server.
at q. (c:\Users\imosan.vscode\extensions\ms-dotnettools.csharp-2.14.8-win32-x64\dist\extension.js:2:1290527)
at Generator.next ()
at s (c:\Users\imosan.vscode\extensions\ms-dotnettools.csharp-2.14.8-win32-x64\dist\extension.js:2:1280557)

@timheuer
Copy link
Member

@imosan how about the output of dotnet --info from a terminal?

@imosan
Copy link

imosan commented Dec 18, 2023

@timheuer here is the result of "dotnet.ext --info"

.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.6a1e483a

ランタイム環境:
OS Name: Windows
OS Version: 10.0.22635
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100\

インストール済みの .NET ワークロード:
Workload version: 8.0.100-manifests.6a1e483a
表示するインストール済みワークロードはありません。

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
2.1.526 [C:\Program Files\dotnet\sdk]
3.1.201 [C:\Program Files\dotnet\sdk]
5.0.416 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

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

Download .NET:
https://aka.ms/dotnet/download

@timheuer
Copy link
Member

Thank you @imosan -- for your case, the dependencies look to be there. Can you share any more info about the workspace and projects within? If you create a new folder with a simple console app in it does it open without issue? Or a fairly full one with supported projects (https://github.com/timheuer/TestSolution)

@imosan
Copy link

imosan commented Dec 18, 2023

@timheuer When installing the Unity extension, it automatically installs the latest versions of C#, C# Dev Kit, IntelliCode for C# Dev Kit and Unity itself.
I tried generating an empty Unity project from scratch and the result was the same. I have uploaded the following for your reference.
https://imosanstorage.blob.core.windows.net/images/TestProject.zip

@vriesj
Copy link
Author

vriesj commented Dec 18, 2023

@timheuer
Hey Tim, thanks for the quick response, just got back in the office, here's some more debugging info.
Feel free to let me know if your team requires any additional debugging information.

Extension version numbers
C# v2.14.8
C# Dev Kit v1.1.16
IntelliCode for C# Dev Kit v0.1.26 (preview)
.NET Install Tool v2.0.0

dotnet --info

PS C:\src> dotnet --info
.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.3b83835e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.3b83835e
 [android]
   Installation Source: VS 17.8.34330.188, VS 17.9.34407.89
   Manifest Version:    34.0.52/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.52\WorkloadManifest.json
   Install Type:              Msi

 [wasm-tools]
   Installation Source: VS 17.8.34330.188, VS 17.9.34407.89
   Manifest Version:    8.0.0/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.0\WorkloadManifest.json
   Install Type:              Msi

 [wasm-tools-net6]
   Installation Source: VS 17.8.34330.188, VS 17.9.34407.89
   Manifest Version:    8.0.0/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net6\8.0.0\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: VS 17.8.34330.188, VS 17.9.34407.89
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.8.34330.188, VS 17.9.34407.89
   Manifest Version:    17.0.8490/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8490\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 17.8.34330.188, VS 17.9.34407.89
   Manifest Version:    17.0.8490/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8490\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  6.0.406 [C:\Program Files\dotnet\sdk]
  7.0.200 [C:\Program Files\dotnet\sdk]
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

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

Download .NET:
  https://aka.ms/dotnet/download

@vriesj
Copy link
Author

vriesj commented Dec 18, 2023

Additionally I've tried to open your provided test solution (https://github.com/timheuer/TestSolution) in my environment which produces the same issue as in the original post and the following logs:

Logs (click to expand)

NuGet

  Determining projects to restore...
C:\src\TestSolution-main\TestBlazorServer\TestBlazorServer.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.Components.Web (>= 7.0.5)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestGrpcService\TestGrpcService.csproj : error NU1100: Unable to resolve 'Grpc.AspNetCore (>= 2.52.0)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\RazorLib\RazorLib.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.Components.Web (>= 7.0.5)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\testwebapi\TestWebApi.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.OpenApi (>= 7.0.5)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\testwebapi\TestWebApi.csproj : error NU1100: Unable to resolve 'Swashbuckle.AspNetCore (>= 6.4.0)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestXUnit\TestXUnit.csproj : error NU1100: Unable to resolve 'FluentAssertions (>= 6.11.0)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestXUnit\TestXUnit.csproj : error NU1100: Unable to resolve 'Microsoft.NET.Test.Sdk (>= 17.6.0)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestXUnit\TestXUnit.csproj : error NU1100: Unable to resolve 'xunit (>= 2.4.2)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestXUnit\TestXUnit.csproj : error NU1100: Unable to resolve 'xunit.runner.visualstudio (>= 2.4.5)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestNUnit\TestNUnit.csproj : error NU1100: Unable to resolve 'NUnit (>= 3.13.3)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestNUnit\TestNUnit.csproj : error NU1100: Unable to resolve 'NUnit3TestAdapter (>= 4.2.1)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\TestNUnit\TestNUnit.csproj : error NU1100: Unable to resolve 'NUnit.Analyzers (>= 3.3.0)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\Testbunit\TestBUnit.csproj : warning NU1603: TestBUnit depends on coverlet.collector (>= 3.1.0) but coverlet.collector 3.1.0 was not found. An approximate best match of coverlet.collector 3.1.2 was resolved. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\Testbunit\TestBUnit.csproj : warning NU1603: TestBUnit depends on Microsoft.NET.Test.Sdk (>= 16.11.0) but Microsoft.NET.Test.Sdk 16.11.0 was not found. An approximate best match of Microsoft.NET.Test.Sdk 17.3.2 was resolved. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\Testbunit\TestBUnit.csproj : error NU1100: Unable to resolve 'bunit (>= 1.20.8)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\Testbunit\TestBUnit.csproj : error NU1100: Unable to resolve 'xunit (>= 2.4.2)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
C:\src\TestSolution-main\Testbunit\TestBUnit.csproj : error NU1100: Unable to resolve 'xunit.runner.visualstudio (>= 2.4.5)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]
  Restored C:\src\TestSolution-main\TestWebApp\TestWebApp.csproj (in 487 ms).
  Restored C:\src\TestSolution-main\TestClassLib\TestClassLib.csproj (in 489 ms).
  Failed to restore C:\src\TestSolution-main\TestBlazorServer\TestBlazorServer.csproj (in 507 ms).
  Failed to restore C:\src\TestSolution-main\TestGrpcService\TestGrpcService.csproj (in 477 ms).
  Restored C:\src\TestSolution-main\TestConsole\TestConsole.csproj (in 507 ms).
  Failed to restore C:\src\TestSolution-main\testwebapi\TestWebApi.csproj (in 479 ms).
  Failed to restore C:\src\TestSolution-main\RazorLib\RazorLib.csproj (in 477 ms).
  Failed to restore C:\src\TestSolution-main\TestXUnit\TestXUnit.csproj (in 630 ms).
  Failed to restore C:\src\TestSolution-main\TestNUnit\TestNUnit.csproj (in 792 ms).
  Restored C:\src\TestSolution-main\TestMSTest\TestMSTest.csproj (in 1,3 sec).
  Failed to restore C:\src\TestSolution-main\Testbunit\TestBUnit.csproj (in 2,17 sec).

C#

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\8335fa39"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 10:34:21 AM] [Program] Language server initialized

C# Dev Kit

Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
Using preinstalled .NET runtime at "C:\Program Files\dotnet\dotnet.exe"
Using runtime installed in SDK.
.NET server started and IPC established in 1910ms
Completed Spawn .NET server (3860ms)
Completed Clear environment (4376ms)
Completed Open a solution with environment service (4429ms)
Starting Restore solution...
Completed Open a solution (4440ms)
Starting NuGet restore for the solution.
Starting command: "dotnet.exe" restore C:\src\TestSolution-main\TestSolution.sln --interactive...
Failed to listen to project initialization status: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.ProjectInitializationStatusService (0.1)" service failed.
Failed at 'command: "dotnet.exe" restore C:\src\TestSolution-main\TestSolution.sln --interactive' (4687ms) with error: ExitCodeError: Failed with ExitCode(1)
Completed NuGet restore with error: DotnetCommandRestoreError: Failed with ExitCode(1)
Completed Restore solution (4691ms)

C# Dev Kit - Test Explorer

Created Test Controller
unable to create test controller for c# extension: Error: Activating the "Microsoft.VisualStudio.TestWindow.VSCode.Service (0.1)" service failed.

C# LSP Trace Logs

Extension vscode.bat does not contribute csharpExtensionLoadPaths
Extension vscode.clojure does not contribute csharpExtensionLoadPaths
Extension vscode.coffeescript does not contribute csharpExtensionLoadPaths
Extension vscode.configuration-editing does not contribute csharpExtensionLoadPaths
Extension vscode.cpp does not contribute csharpExtensionLoadPaths
Extension vscode.csharp does not contribute csharpExtensionLoadPaths
Extension vscode.css does not contribute csharpExtensionLoadPaths
Extension vscode.css-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.dart does not contribute csharpExtensionLoadPaths
Extension vscode.debug-auto-launch does not contribute csharpExtensionLoadPaths
Extension vscode.debug-server-ready does not contribute csharpExtensionLoadPaths
Extension vscode.diff does not contribute csharpExtensionLoadPaths
Extension vscode.docker does not contribute csharpExtensionLoadPaths
Extension vscode.emmet does not contribute csharpExtensionLoadPaths
Extension vscode.extension-editing does not contribute csharpExtensionLoadPaths
Extension vscode.fsharp does not contribute csharpExtensionLoadPaths
Extension vscode.git does not contribute csharpExtensionLoadPaths
Extension vscode.git-base does not contribute csharpExtensionLoadPaths
Extension vscode.github does not contribute csharpExtensionLoadPaths
Extension vscode.github-authentication does not contribute csharpExtensionLoadPaths
Extension vscode.go does not contribute csharpExtensionLoadPaths
Extension vscode.groovy does not contribute csharpExtensionLoadPaths
Extension vscode.grunt does not contribute csharpExtensionLoadPaths
Extension vscode.gulp does not contribute csharpExtensionLoadPaths
Extension vscode.handlebars does not contribute csharpExtensionLoadPaths
Extension vscode.hlsl does not contribute csharpExtensionLoadPaths
Extension vscode.html does not contribute csharpExtensionLoadPaths
Extension vscode.html-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.ini does not contribute csharpExtensionLoadPaths
Extension vscode.ipynb does not contribute csharpExtensionLoadPaths
Extension vscode.jake does not contribute csharpExtensionLoadPaths
Extension vscode.java does not contribute csharpExtensionLoadPaths
Extension vscode.javascript does not contribute csharpExtensionLoadPaths
Extension vscode.json does not contribute csharpExtensionLoadPaths
Extension vscode.json-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.julia does not contribute csharpExtensionLoadPaths
Extension vscode.latex does not contribute csharpExtensionLoadPaths
Extension vscode.less does not contribute csharpExtensionLoadPaths
Extension vscode.log does not contribute csharpExtensionLoadPaths
Extension vscode.lua does not contribute csharpExtensionLoadPaths
Extension vscode.make does not contribute csharpExtensionLoadPaths
Extension vscode.markdown does not contribute csharpExtensionLoadPaths
Extension vscode.markdown-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.markdown-math does not contribute csharpExtensionLoadPaths
Extension vscode.media-preview does not contribute csharpExtensionLoadPaths
Extension vscode.merge-conflict does not contribute csharpExtensionLoadPaths
Extension vscode.microsoft-authentication does not contribute csharpExtensionLoadPaths
Extension ms-vscode-remote.remote-wsl-recommender does not contribute csharpExtensionLoadPaths
Extension ms-vscode.js-debug does not contribute csharpExtensionLoadPaths
Extension ms-vscode.js-debug-companion does not contribute csharpExtensionLoadPaths
Extension ms-vscode.vscode-js-profile-table does not contribute csharpExtensionLoadPaths
Extension vscode.builtin-notebook-renderers does not contribute csharpExtensionLoadPaths
Extension vscode.npm does not contribute csharpExtensionLoadPaths
Extension vscode.objective-c does not contribute csharpExtensionLoadPaths
Extension vscode.perl does not contribute csharpExtensionLoadPaths
Extension vscode.php does not contribute csharpExtensionLoadPaths
Extension vscode.php-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.powershell does not contribute csharpExtensionLoadPaths
Extension vscode.pug does not contribute csharpExtensionLoadPaths
Extension vscode.python does not contribute csharpExtensionLoadPaths
Extension vscode.r does not contribute csharpExtensionLoadPaths
Extension vscode.razor does not contribute csharpExtensionLoadPaths
Extension vscode.references-view does not contribute csharpExtensionLoadPaths
Extension vscode.restructuredtext does not contribute csharpExtensionLoadPaths
Extension vscode.ruby does not contribute csharpExtensionLoadPaths
Extension vscode.rust does not contribute csharpExtensionLoadPaths
Extension vscode.scss does not contribute csharpExtensionLoadPaths
Extension vscode.search-result does not contribute csharpExtensionLoadPaths
Extension vscode.shaderlab does not contribute csharpExtensionLoadPaths
Extension vscode.shellscript does not contribute csharpExtensionLoadPaths
Extension vscode.simple-browser does not contribute csharpExtensionLoadPaths
Extension vscode.sql does not contribute csharpExtensionLoadPaths
Extension vscode.swift does not contribute csharpExtensionLoadPaths
Extension vscode.theme-abyss does not contribute csharpExtensionLoadPaths
Extension vscode.theme-defaults does not contribute csharpExtensionLoadPaths
Extension vscode.theme-kimbie-dark does not contribute csharpExtensionLoadPaths
Extension vscode.theme-monokai does not contribute csharpExtensionLoadPaths
Extension vscode.theme-monokai-dimmed does not contribute csharpExtensionLoadPaths
Extension vscode.theme-quietlight does not contribute csharpExtensionLoadPaths
Extension vscode.theme-red does not contribute csharpExtensionLoadPaths
Extension vscode.vscode-theme-seti does not contribute csharpExtensionLoadPaths
Extension vscode.theme-solarized-dark does not contribute csharpExtensionLoadPaths
Extension vscode.theme-solarized-light does not contribute csharpExtensionLoadPaths
Extension vscode.theme-tomorrow-night-blue does not contribute csharpExtensionLoadPaths
Extension vscode.tunnel-forwarding does not contribute csharpExtensionLoadPaths
Extension vscode.typescript does not contribute csharpExtensionLoadPaths
Extension vscode.typescript-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.vb does not contribute csharpExtensionLoadPaths
Extension vscode.xml does not contribute csharpExtensionLoadPaths
Extension vscode.yaml does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.csdevkit does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.csharp does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.vscode-dotnet-runtime does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.vscodeintellicode-csharp does not contribute csharpExtensionLoadPaths
Extension shalimski.swapdiff does not contribute csharpExtensionLoadPaths

IntelliCode for C# Dev Kit

Inline Completions document change subscription registered.

Razor Log

--------------------------------------------------------------------------------
Razor.VSCode version 7.0.0-preview.23528.1
--------------------------------------------------------------------------------
Razor's trace level is currently set to 'Off'
 - To change Razor's trace level set 'razor.trace' to 'Off', 'Messages' or 'Verbose' and then restart VSCode.
 - To report issues invoke the 'Report a Razor issue' command via the command palette.
-----------------------------------------------------------------------------------------------------------------------------

Using dotnet configured on PATH
[Info  - 10:34:23 AM] Razor Language Server started successfully.

@lukewis
Copy link

lukewis commented Dec 18, 2023

@imosan / @lukewis -- can you share any output you have from the "C#" and "C# Dev Kit" output logs within VSCode as well as dotnet --info outputs?

My logs look a bit different. If you feel mine is a different issue, let me know and I'll transfer it to a new ticket. Worth mentioning - mine is using the remote ssh extension to connect from MacOS -> Ubuntu.

C# output

Using dotnet configured on PATH
Dotnet path: /snap/dotnet-sdk/228/dotnet
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"/tmp/7b89e969.sock"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 5:43:43 AM] [Program] Language server initialized

C# DevKit

Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
Using local .NET runtime at "/home/lawisnie/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.14~x64/dotnet"
Using runtime installed in SDK.
.NET server started and IPC established in 2408ms
Completed Spawn .NET server (8222ms)
.NET server STDERR: Unhandled exception. 
.NET server STDERR: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.ServiceHub.Controller.LocationService.OnHostExit(HostInfo host, Int32 exitCode)
   at Microsoft.ServiceHub.Controller.LocationService.<>c__DisplayClass61_0.<StartNewHostAsync>b__0(Object s, EventArgs e)
   at System.Diagnostics.Process.RaiseOnExited()
   at System.Diagnostics.Process.CompletionCallback(Object waitHandleContext, Boolean wasSignaled)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.PortableThreadPool.CompleteWait(RegisteredWaitHandle handle, Boolean timedOut)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
.NET server STDERR: 

.NET server STDOUT: [createdump] Gathering state for process 1651316 Microsoft.Servi
[createdump] Crashing thread 193288 signal 6 (0006)

Completed Clear environment (8949ms)
Completed Open a solution with environment service (9022ms)
Starting Restore solution...
Completed Open a solution (9050ms)
Starting NuGet restore for the solution.
Starting command: "dotnet" restore /home/lawisnie/src/figtree-media/figtree-media.sln --interactive...
.NET server STDOUT: [createdump] Writing crash report to file /home/lawisnie/.cache/Microsoft/csdevkit/dumps/Microsoft.Servi.1651316.dmp.crashreport.json

.NET server STDOUT: [createdump] Crash report successfully written

Completed command: "dotnet" restore /home/lawisnie/src/figtree-media/figtree-media.sln --interactive (3772ms)
Completed NuGet restore.
Completed Restore solution (3778ms)
.NET server STDOUT: [createdump] Writing minidump with heap to file /home/lawisnie/.cache/Microsoft/csdevkit/dumps/Microsoft.Servi.1651316.dmp

.NET server STDOUT: [createdump] Written 201625600 bytes (49225 pages) to core file
[createdump] Target process is alive

.NET server STDOUT: [createdump] Dump successfully written in 17315ms

Failed to listen to project initialization status: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.ProjectInitializationStatusService (0.1)" service failed.

dotnet info

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.6c33ef20

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /snap/dotnet-sdk/228/sdk/8.0.100/

.NET workloads installed:
 Workload version: 8.0.100-manifests.6c33ef20
There are no installed workloads to display.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  8.0.100 [/snap/dotnet-sdk/228/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0 [/snap/dotnet-sdk/228/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.0 [/snap/dotnet-sdk/228/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Attached is the crashreport. I can provide the dmp file too, but it's too large to attach here.
Microsoft.Servi.1651316.dmp.crashreport.json

@timheuer
Copy link
Member

@timheuer ... I have uploaded the following for your reference. imosanstorage.blob.core.windows.net/images/TestProject.zip

Thanks! @jbevain can you take a look at this one? I think it might be project type support issue?

@timheuer timheuer added the area-unity Unity support label Dec 18, 2023
@timheuer
Copy link
Member

My logs look a bit different. If you feel mine is a different issue, let me know and I'll transfer it to a new ticket. Worth mentioning - mine is using the remote ssh extension to connect from MacOS -> Ubuntu.

@lukewis yes this looks different would you mind spawning a new issue with the great detail you put here. And wondering how we can find a way to get the dump...that looks like it might be helpful. If you could also add to that issue the project type, etc. and if a new/blank workspace with only a console app works for you (just trying to isolate simple -> complex)

@sailro
Copy link
Member

sailro commented Dec 19, 2023

@timheuer I had a look a the test project provided by @imosan .

This is not generated by us but rather by the default Unity project generator. And the project is a legacy style project so that's why this is not working with VSCode / C# Dev Kit.

@imosan please have a look here to properly setup VSCode and Unity:
https://code.visualstudio.com/docs/other/unity

The initial poster of this ticket @vriesj is not using Unity here if I'm not wrong, so I fear we are mixing up things in this ticket.

@vriesj
Copy link
Author

vriesj commented Dec 19, 2023

The initial poster of this ticket @vriesj is not using Unity here if I'm not wrong, so I fear we are mixing up things in this ticket.

I am indeed not using Unity.

However if the behavior is the same, i.e. the solution explorer not loading, I think we should file it here under #808.

If any projects in a solution are unable to load or incompatible it should still load as many projects as possible, similar to Visual Studio 2022, and then show the others as (unloaded) with a descriptive error.

Honestly I'd rather see an entire stack track in the logs / pop-up instead of Activating the service failed. (0.1) cause as an end user it makes the issue hard to differentiate from other similar issues.

@lukewis
Copy link

lukewis commented Dec 19, 2023

My logs look a bit different. If you feel mine is a different issue, let me know and I'll transfer it to a new ticket. Worth mentioning - mine is using the remote ssh extension to connect from MacOS -> Ubuntu.

@lukewis yes this looks different would you mind spawning a new issue with the great detail you put here. And wondering how we can find a way to get the dump...that looks like it might be helpful. If you could also add to that issue the project type, etc. and if a new/blank workspace with only a console app works for you (just trying to isolate simple -> complex)

Moved my issue to #816. Sorry for the cross-pollination.

@timheuer
Copy link
Member

C:\src\TestSolution-main\testwebapi\TestWebApi.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.OpenApi (>= 7.0.5)' for 'net7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, ComponentOne Local, Local, nuget.org, Contoso_Feed. [C:\src\TestSolution-main\TestSolution.sln]

@vriesj you are failing to even get some basic restores. I see PackageSourceMapping is enabled and indicating nuget.org not considered trying to resolve. Does restore even work from the command line on this solution?

@imosan
Copy link

imosan commented Dec 20, 2023

@timheuer I created a simple consoleApp1 in Visual Studio 2022 and opened it in vscode, but the result was exactly the same as in the case of a Unity project. Currently, it seems that the only way to address this issue here is through a method like the one described in the following link:
https://www.blender-ikkinomi.com/blog/en/blog-16-dec-2023-0

@timheuer
Copy link
Member

@imosan you can certainly revert back to a version, but you'd no longer be using this extension (those instructions are to revert to an older language server extension), but we'd like you to use the unity setup per the note above.

@ThomasCode92
Copy link

Any updates on this issue?
I'm utilizing WSL along with asdf, and I've installed dotnet version 8.0.100. When I open my solution (you can find it here), I get this output from C# Dev kit

´´´
Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
Using local .NET runtime at "/home/thomas/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.14~x64/dotnet"
Using runtime installed in SDK.
.NET server started and IPC established in 1592ms
Completed Spawn .NET server (3420ms)
Completed Clear environment (4753ms)
Completed Open a solution with environment service (4864ms)
Starting Restore solution...
Completed Open a solution (5005ms)
Starting NuGet restore for the solution.
Starting command: "dotnet" restore /home/thomas/repos/DDD/Integrating-via-Messaging/DDDesign.sln --interactive...
Failed to listen to project initialization status: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.ProjectInitializationStatusService (0.1)" service failed.
´´´

@jbevain jbevain removed the area-unity Unity support label Jan 3, 2024
@caiofbpa
Copy link

I also had this issue on my Mac for a couple of days and managed to solve it by:

brew remove dotnet

And then following the default installation steps in: https://learn.microsoft.com/en-us/dotnet/core/install/macos

This is really weird as it seems Microsoft's C# Dev Kit is not able to use dotnet installations made by other tools, could it be relying on dotnet being on a specific location?

@jantanis
Copy link

Thank you @caiofbpa! This fixed it for me too.

@sealamb
Copy link

sealamb commented Apr 17, 2024

@caiofbpa THANK YOU! Your suggestion solved my similar problem.

@arkalyanms
Copy link
Member

Removing high-priority since there is a workaround. Seems to be a dotnet setup issue. cc: @lifengl and @nagilson

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
Projects
None yet
Development

No branches or pull requests