dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 669 forks source link

LanguageServerProjectSystem throws System.URIFormatException #6218

Closed timothyparez closed 1 year ago

timothyparez commented 1 year ago

Type: Bug

Issue Description

VSCode was working just fine for many years until the language
server started failing recently.

When it stopped working I completely removed vscode from my system and deleted all my user data as well.

I then re-installed vscode and for a single session it was working. After a system reboot it stopped working again.

Steps to Reproduce

Open any folder containing a C# project.

Expected Behavior

For it to load normally like before.

Actual Behavior

Logs

Using dotnet configured on PATH
Dotnet path: ../lib/dotnet/dotnet
Activating C# standalone...
[Info  - 10:35:44 AM] [Program]Language server initialized
[Info  - 10:35:44 AM] [LanguageServerProjectSystem]Loaded MSBuild at /usr/lib/dotnet/sdk/7.0.110
[Info  - 10:35:44 AM] [LanguageServerProjectSystem]Loading /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverDemo.sln...
[Error - 10:35:45 AM] [LanguageServerProjectSystem]Exception thrown while loading /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverDemo.csproj System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 174
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext.<>c.<.ctor>b__5_0(WatchedDirectory d) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext..ctor(ImmutableArray`1 watchedDirectories, LspFileChangeWatcher lspFileChangeWatcher) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 43
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.DelegatingFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/DelegatingFileChangeWatcher.cs:line 56
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.<>c__DisplayClass5_0.<.ctor>b__0() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 87
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.CreateReferenceAndStartWatchingFile(String fullFilePath, MetadataReferenceProperties properties) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 100
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.<>c__DisplayClass102_0.<OnBatchScopeDisposedMaybeAsync>b__0(SolutionChangeAccumulator solutionChanges) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 602
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass46_0.<ApplyBatchChangeToWorkspaceMaybeAsync>b__0(Solution oldSolution) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 262
   at Microsoft.CodeAnalysis.Workspace.<>c.<SetCurrentSolutionAsync>b__27_3(Solution oldSolution, ValueTuple`5 data) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 249
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync[TData](Boolean useAsync, TData data, Func`3 transformation, Boolean mayRaiseEvents, Action`3 onBeforeUpdate, Action`3 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 408
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync(Boolean useAsync, Func`2 transformation, Func`3 changeKind, Action`2 onBeforeUpdate, Action`2 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 244
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.ApplyBatchChangeToWorkspaceMaybeAsync(Boolean useAsync, Action`1 mutation) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 257
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.OnBatchScopeDisposedMaybeAsync(Boolean useAsync) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 520
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.BatchScope.DisposeAsync() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 493
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.UpdateWithNewProjectInfoAsync(ProjectFileInfo newProjectInfo) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 145
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.LoadOrReloadProjectAsync(String projectPath, ProjectBuildManager projectBuildManager, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 240
[Info  - 10:35:45 AM] [LanguageServerProjectSystem]Completed (re)load of all projects in 00:00:00.6063257
[Info  - 10:49:33 AM] Shutting down
Using dotnet configured on PATH
Dotnet path: ../lib/dotnet/dotnet
Activating C# standalone...
Starting server at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Remote.Workspaces.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.CSharp.Workspaces.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Workspaces.MSBuild.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Scripting.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.CSharp.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Razor.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Workspaces.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.AnalyzerUtilities.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Elfie.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.CSharp.Features.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
      Solution-level analyzer at /home/timothy/.vscode/extensions/ms-dotnettools.csharp-2.0.413-linux-x64/.roslyn/Microsoft.CodeAnalysis.Features.dll added to workspace.
[Info  - 10:49:34 AM] [Program]Language server initialized
[LanguageServerHost][02:49:34.520][Start]initialize
[LanguageServerHost][02:49:34.523][Start]Initialize
[LanguageServerHost][02:49:34.568][End]Initialize
[LanguageServerHost][02:49:34.602][End]initialize
[LanguageServerHost][02:49:34.604][Start]initialized
[LanguageServerHost][02:49:34.697][End]initialized
[LanguageServerHost][02:49:34.699][Start]solution/open
[LanguageServerHost][02:49:34.699][Start]textDocument/didOpen
[LanguageServerHost]didOpen for file:///home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs
[LanguageServerHost][02:49:34.706][End]textDocument/didOpen
[Info  - 10:49:34 AM] [LanguageServerProjectSystem]Loaded MSBuild at /usr/lib/dotnet/sdk/7.0.110
[Info  - 10:49:34 AM] [LanguageServerProjectSystem]Loading /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverDemo.sln...
[LanguageServerHost]Could not find 'file:///home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs'.  Searched Host
[LanguageServerHost][02:49:34.769][Start]textDocument/diagnostic
[LanguageServerHost]PublicDocumentPullDiagnosticsHandler(category: ) started getting diagnostics
[LanguageServerHost]previousResults.Length=0
[LanguageServerHost]Processing 1 documents
[LanguageServerHost][02:49:34.784][Start]workspace/diagnostic
[LanguageServerHost]PublicWorkspacePullDiagnosticsHandler(category: ) started getting diagnostics
[LanguageServerHost]previousResults.Length=0
[LanguageServerHost]Processing 0 documents
[LanguageServerHost]Closing workspace/diagnostics request
[LanguageServerHost]Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics.Public.PublicWorkspacePullDiagnosticsHandler finished getting diagnostics
[LanguageServerHost][02:49:34.798][End]workspace/diagnostic
[LanguageServerHost]Found 0 diagnostics for DocumentDiagnosticSource: /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs in Miscellaneous Files
[LanguageServerHost]Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics.Public.PublicDocumentPullDiagnosticsHandler finished getting diagnostics
[LanguageServerHost][02:49:34.858][End]textDocument/diagnostic
[LanguageServerHost]/home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs found in workspace MiscellaneousFiles
[LanguageServerHost][02:49:35.062][Start]textDocument/diagnostic
[LanguageServerHost]PublicDocumentPullDiagnosticsHandler(category: ) started getting diagnostics
[LanguageServerHost]previousResults.Length=1
[LanguageServerHost]Processing 1 documents
[LanguageServerHost]Diagnostics were unchanged for DocumentDiagnosticSource: /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs in Miscellaneous Files
[LanguageServerHost]Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics.Public.PublicDocumentPullDiagnosticsHandler finished getting diagnostics
[LanguageServerHost][02:49:35.070][End]textDocument/diagnostic
[Error - 10:49:35 AM] [LanguageServerProjectSystem]Exception thrown while loading /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverDemo.csproj System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 174
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext.<>c.<.ctor>b__5_0(WatchedDirectory d) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext..ctor(ImmutableArray`1 watchedDirectories, LspFileChangeWatcher lspFileChangeWatcher) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 43
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.DelegatingFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/DelegatingFileChangeWatcher.cs:line 56
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.<>c__DisplayClass5_0.<.ctor>b__0() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 87
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.CreateReferenceAndStartWatchingFile(String fullFilePath, MetadataReferenceProperties properties) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 100
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.<>c__DisplayClass102_0.<OnBatchScopeDisposedMaybeAsync>b__0(SolutionChangeAccumulator solutionChanges) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 602
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass46_0.<ApplyBatchChangeToWorkspaceMaybeAsync>b__0(Solution oldSolution) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 262
   at Microsoft.CodeAnalysis.Workspace.<>c.<SetCurrentSolutionAsync>b__27_3(Solution oldSolution, ValueTuple`5 data) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 249
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync[TData](Boolean useAsync, TData data, Func`3 transformation, Boolean mayRaiseEvents, Action`3 onBeforeUpdate, Action`3 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 408
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync(Boolean useAsync, Func`2 transformation, Func`3 changeKind, Action`2 onBeforeUpdate, Action`2 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 244
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.ApplyBatchChangeToWorkspaceMaybeAsync(Boolean useAsync, Action`1 mutation) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 257
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.OnBatchScopeDisposedMaybeAsync(Boolean useAsync) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 520
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.BatchScope.DisposeAsync() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 493
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.UpdateWithNewProjectInfoAsync(ProjectFileInfo newProjectInfo) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 145
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.LoadOrReloadProjectAsync(String projectPath, ProjectBuildManager projectBuildManager, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 240
[Info  - 10:49:35 AM] [LanguageServerProjectSystem]Completed (re)load of all projects in 00:00:00.5110403
[LanguageServerHost][02:49:35.391][End]solution/open
[LanguageServerHost][02:49:35.395][Start]workspace/debugConfiguration
[LanguageServerHost][02:49:35.400][End]workspace/debugConfiguration
[LanguageServerHost]/home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs found in workspace MiscellaneousFiles
[LanguageServerHost][02:49:36.690][Start]textDocument/diagnostic
[LanguageServerHost]PublicDocumentPullDiagnosticsHandler(category: ) started getting diagnostics
[LanguageServerHost]previousResults.Length=1
[LanguageServerHost]Processing 1 documents
[LanguageServerHost]Diagnostics were unchanged for DocumentDiagnosticSource: /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs in Miscellaneous Files
[LanguageServerHost]Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics.Public.PublicDocumentPullDiagnosticsHandler finished getting diagnostics
[LanguageServerHost][02:49:36.691][End]textDocument/diagnostic
[LanguageServerHost][02:49:36.800][Start]workspace/diagnostic
[LanguageServerHost]PublicWorkspacePullDiagnosticsHandler(category: ) started getting diagnostics
[LanguageServerHost]previousResults.Length=0
[LanguageServerHost]Processing 0 documents
[LanguageServerHost]Closing workspace/diagnostics request
[LanguageServerHost]Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics.Public.PublicWorkspacePullDiagnosticsHandler finished getting diagnostics
[LanguageServerHost][02:49:36.804][End]workspace/diagnostic
[LanguageServerHost][02:49:38.809][Start]workspace/diagnostic
[LanguageServerHost]PublicWorkspacePullDiagnosticsHandler(category: ) started getting diagnostics
[LanguageServerHost]previousResults.Length=0
[LanguageServerHost]Processing 0 documents

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

Environment information

VSCode version: 1.81.1 C# Extension: 2.0.413 Using OmniSharp: false

Dotnet Information .NET SDK: Version: 7.0.110 Commit: ba920f88ac Runtime Environment: OS Name: ubuntu OS Version: 23.04 OS Platform: Linux RID: ubuntu.23.04-x64 Base Path: /usr/lib/dotnet/sdk/7.0.110/ Host: Version: 7.0.10 Architecture: x64 Commit: a6dbb800a4 .NET SDKs installed: 6.0.121 [/usr/lib/dotnet/sdk] 7.0.110 [/usr/lib/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.21 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.10 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.21 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.10 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: /home/timothy/global.json Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
Visual Studio Code Extensions |Extension|Author|Version|Folder Name| |---|---|---|---| |azure-account|ms-vscode|0.11.5|ms-vscode.azure-account-0.11.5| |azure-repos|ms-vscode|0.36.0|ms-vscode.azure-repos-0.36.0| |better-cpp-syntax|jeff-hykin|1.17.2|jeff-hykin.better-cpp-syntax-1.17.2| |blazorwasm-companion|ms-dotnettools|1.1.4|ms-dotnettools.blazorwasm-companion-1.1.4| |blender-development|JacquesLucke|0.0.18|jacqueslucke.blender-development-0.0.18| |blender-python-code-templates|blenderfreetimeprojects|0.9.6|blenderfreetimeprojects.blender-python-code-templates-0.9.6| |cmake|twxs|0.0.17|twxs.cmake-0.0.17| |cmake-language-support-vscode|josetr|0.0.9|josetr.cmake-language-support-vscode-0.0.9| |cmake-tools|ms-vscode|1.15.31|ms-vscode.cmake-tools-1.15.31| |cpptools|ms-vscode|1.17.4|ms-vscode.cpptools-1.17.4-linux-x64| |cpptools-extension-pack|ms-vscode|1.3.0|ms-vscode.cpptools-extension-pack-1.3.0| |cpptools-themes|ms-vscode|2.0.0|ms-vscode.cpptools-themes-2.0.0| |csharp|ms-dotnettools|2.0.413|ms-dotnettools.csharp-2.0.413-linux-x64| |dart-code|Dart-Code|3.70.0|dart-code.dart-code-3.70.0| |data-workspace-vscode|ms-mssql|0.5.0|ms-mssql.data-workspace-vscode-0.5.0| |dotnet-interactive-vscode|ms-dotnettools|1.0.4403010|ms-dotnettools.dotnet-interactive-vscode-1.0.4403010| |doxdocgen|cschlosser|1.4.0|cschlosser.doxdocgen-1.4.0| |esp-idf-extension|espressif|1.6.4|espressif.esp-idf-extension-1.6.4| |fabric8-analytics|redhat|0.3.10|redhat.fabric8-analytics-0.3.10| |git-graph|mhutchie|1.30.0|mhutchie.git-graph-1.30.0| |git-log--graph|phil294|0.1.12|phil294.git-log--graph-0.1.12| |godot-csharp-vscode|neikeq|0.2.1|neikeq.godot-csharp-vscode-0.2.1| |godot-tools|geequlim|1.3.1|geequlim.godot-tools-1.3.1| |hexeditor|ms-vscode|1.9.12|ms-vscode.hexeditor-1.9.12| |html-preview-vscode|george-alisson|0.2.5|george-alisson.html-preview-vscode-0.2.5| |intellicode-api-usage-examples|VisualStudioExptTeam|0.2.7|visualstudioexptteam.intellicode-api-usage-examples-0.2.7| |isort|ms-python|2023.10.1|ms-python.isort-2023.10.1| |java|redhat|1.21.0|redhat.java-1.21.0-linux-x64| |jupyter|ms-toolsai|2023.7.1002162226|ms-toolsai.jupyter-2023.7.1002162226-linux-x64| |makefile-tools|ms-vscode|0.7.0|ms-vscode.makefile-tools-0.7.0| |mono-debug|ms-vscode|0.16.3|ms-vscode.mono-debug-0.16.3| |mssql|ms-mssql|1.20.1|ms-mssql.mssql-1.20.1| |polacode|pnp|0.3.4|pnp.polacode-0.3.4| |prettier-vscode|esbenp|10.1.0|esbenp.prettier-vscode-10.1.0| |prettify-json|mohsen1|0.0.3|mohsen1.prettify-json-0.0.3| |proto|peterj|0.0.4|peterj.proto-0.0.4| |python|ms-python|2023.14.0|ms-python.python-2023.14.0| |remote-containers|ms-vscode-remote|0.304.0|ms-vscode-remote.remote-containers-0.304.0| |remote-explorer|ms-vscode|0.4.1|ms-vscode.remote-explorer-0.4.1| |remote-repositories|ms-vscode|0.38.1|ms-vscode.remote-repositories-0.38.1| |remote-ssh|ms-vscode-remote|0.102.0|ms-vscode-remote.remote-ssh-0.102.0| |remote-ssh-edit|ms-vscode-remote|0.86.0|ms-vscode-remote.remote-ssh-edit-0.86.0| |shader|slevesque|1.1.5|slevesque.shader-1.1.5| |sql-bindings-vscode|ms-mssql|0.4.0|ms-mssql.sql-bindings-vscode-0.4.0| |sql-database-projects-vscode|ms-mssql|1.2.0|ms-mssql.sql-database-projects-vscode-1.2.0| |vscode-arduino|vsciot-vscode|0.6.0|vsciot-vscode.vscode-arduino-0.6.0-linux-x64| |vscode-azurefunctions|ms-azuretools|1.12.4|ms-azuretools.vscode-azurefunctions-1.12.4| |vscode-azureresourcegroups|ms-azuretools|0.7.5|ms-azuretools.vscode-azureresourcegroups-0.7.5| |vscode-counter|uctakeoff|3.2.1|uctakeoff.vscode-counter-3.2.1| |vscode-docker|ms-azuretools|1.26.0|ms-azuretools.vscode-docker-1.26.0| |vscode-dotnet-runtime|ms-dotnettools|1.7.0|ms-dotnettools.vscode-dotnet-runtime-1.7.0| |vscode-drawio|hediet|1.6.6|hediet.vscode-drawio-1.6.6| |vscode-edge-devtools|ms-edgedevtools|2.1.3|ms-edgedevtools.vscode-edge-devtools-2.1.3| |vscode-java-debug|vscjava|0.53.0|vscjava.vscode-java-debug-0.53.0| |vscode-java-dependency|vscjava|0.23.1|vscjava.vscode-java-dependency-0.23.1| |vscode-java-pack|vscjava|0.25.13|vscjava.vscode-java-pack-0.25.13| |vscode-java-test|vscjava|0.39.1|vscjava.vscode-java-test-0.39.1| |vscode-m5stack-mpy|curdeveryday|1.1.10|curdeveryday.vscode-m5stack-mpy-1.1.10| |vscode-maven|vscjava|0.42.0|vscjava.vscode-maven-0.42.0| |vscode-nanoframework|nanoframework|1.0.138|nanoframework.vscode-nanoframework-1.0.138| |vscode-pylance|ms-python|2023.8.40|ms-python.vscode-pylance-2023.8.40| |vscode-serial-monitor|ms-vscode|0.10.0|ms-vscode.vscode-serial-monitor-0.10.0| |vscode-typescript-next|ms-vscode|5.3.20230823|ms-vscode.vscode-typescript-next-5.3.20230823| |vscode-xml|redhat|0.26.1|redhat.vscode-xml-0.26.1-linux-x64| |vscodeintellicode|VisualStudioExptTeam|1.2.30|visualstudioexptteam.vscodeintellicode-1.2.30| |vsliveshare|ms-vsliveshare|1.0.5883|ms-vsliveshare.vsliveshare-1.0.5883| |vsliveshare-pack|ms-vsliveshare|0.4.0|ms-vsliveshare.vsliveshare-pack-0.4.0|;

Extension version: 2.0.413 VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:18:39.991Z) OS version: Linux x64 6.2.0-27-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5950X 16-Core Processor (32 x 2879)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|2, 2, 2| |Memory (System)|125.70GB (110.80GB free)| |Process Argv|/home/timothy/Documents/Projects/DmxReceiverDemo/ -g /home/timothy/Documents/Projects/DmxReceiverDemo/DmxReceiverNode.cs:0:0 --crash-reporter-id 8994cbb0-c55e-437d-943b-5cca539c73af| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263cf:30792227 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30803844 3biah626:30602489 f6dab269:30613381 showlangstatbar:30737416 03d35959:30757346 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 gsofb:30804716 pythonnosmt12:30797651 pythonidxpt:30805730 pythonnoceb:30805159 dsvsc013:30795093 dsvsc014:30804076 diffeditorv2:30812749 ```
timothyparez commented 1 year ago

Here's another example:

mkdir test
cd test
dotnet new console
code .

Output:

=====================
8/24/2023 11:01:06AM
LimitedFunctionality
System.AggregateException: Project system data flow 'Workspace update handler ActionBlockSlimAsync`1' closed because of an exception: Invalid URI: The format of the URI could not be determined.. (Invalid URI: The format of the URI could not be determined.)
---> (Inner Exception #0) StreamJsonRpc.RemoteInvocationException: Invalid URI: The format of the URI could not be determined.
   at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList`1 arguments, IReadOnlyList`1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass45_1`1.<<OnProjectChangedAsync>g__ApplyInBatchAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<>c__DisplayClass3_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.ExecuteAsync(Func`1 operation, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.ExecuteUnderLockCoreAsync(Func`2 action, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.OnBuildUpdateAsync(IProjectVersionedValue`1 update)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass41_0.<<OnWorkspaceUpdateAsync>g__ApplyUpdateWithinLockAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass41_0.<<OnWorkspaceUpdateAsync>g__ApplyUpdateWithinLockAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass41_0.<<OnWorkspaceUpdateAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<>c__DisplayClass3_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.ExecuteAsync(Func`1 operation, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.ExecuteUnderLockCoreAsync(Func`2 action, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.ProcessInputQueueAsync(InputDataBuffer inputQueue)
<--- (Inner Exception #0) 
===================

Reverting to an older version of VSCode (v1.79) does not resolve the issue either.

Switching back to Onmisharp-Server in the settings seems to work (but things are mostly still broken)

zgx commented 1 year ago

got the same error too

lonix1 commented 1 year ago

This started once I upgraded to the latest extension from a few hours ago 2.0.413.

I can't load any projects.

(not using c# dev kit, ubuntu 22.04)

JanusTida commented 1 year ago

got the same error too,I'm using wsl ubuntu 20.04,and c# dev kit is not installed,and it worked just fine yesterday.

lonix1 commented 1 year ago

Error disappears when downgrading to previous version: 2.0.376

koyllis commented 1 year ago

I have the exact same issue on ubuntu 23.04

nZeus commented 1 year ago

It also fails after I downgraded to 2.0.376 (I'm using MacOS):

2023-08-24 11:23:20.014 [error] [ms-dotnettools.csharp] provider FAILED
2023-08-24 11:23:20.015 [error] Error: Invalid URI: The format of the URI could not be determined.
    at /Users/iliatsvetkov/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-arm64/dist/extension.js:2:2191134
    at re (/Users/iliatsvetkov/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-arm64/dist/extension.js:2:2191428)
    at /Users/iliatsvetkov/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-arm64/dist/extension.js:2:2186212
    at Immediate.<anonymous> (/Users/iliatsvetkov/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-arm64/dist/extension.js:2:2186232)
    at process.processImmediate (node:internal/timers:466:21)

UPD. ✅ I downgraded to v2.0.328 - now it works

bjornharrtell commented 1 year ago

Downgrade to 2.0.376 works for me too. The latest version published to vscode (2.0.413) is not even tagged here.

Kidsunbo commented 1 year ago

Same problem. And C# extension is broken again? Maybe you guys should add more test case or hire more QA.

DavideC84 commented 1 year ago

Got the same error this morning on my Visual Studio Code, using it to code a remote project (via SSH) on a Debian Linux machine. Looks like a problem in the path (which doesn't reflect the actual remote project URI). Downgrading C# extension to previous version solved the problem for me.

borsna commented 1 year ago

Same problem for me using the extension on ubuntu 22.04 via wsl. downgrading to v2.0.376 fixed the problem

paillave commented 1 year ago

same here on ubuntu 23.04

ltuuri commented 1 year ago

Same here on WSL1 + fresh install Ubuntu 23.10 with it's default dotnet sdk 7.0.9 + fresh dotnet new console. On same Win 10 host it worked if project was in c::\users\ ... ... but not in WSL.

Downgrading to v2.0.376 fixed the problem

The current one crashed right away. Ne previous version first installed dotnet 7.0.10 runtime in ~ but then started to work

lonix1 commented 1 year ago

@arkalyanms @dibarbet I don't understand the 4 re-releases made in the last few hours (366, 376, 399, 413), and the "September" milestone event above.

Am I right in assuming that this will only be addressed next month?

(The latest 413 release introduced a major bug, won't a hotfix be released before then?)

JanusTida commented 1 year ago

The 2.0+ version is totally a disaster,it brings so many problems that the previous versions do not have :( now I have to roll back to version 1.26,thanks god this version works perfectly while later versions suck!

timothyparez commented 1 year ago

For those, like me, who need this to do their job, I suggest you switch back to Omnisharp for now.
This is the only thing that worked for me. So in other words stick with the current version but enable Omnisharp

image

(Makes me wonder if we even need something new instead of Omnisharp)

arkalyanms commented 1 year ago

@Cosifne would you help take a look? This is a recent regression.

@lonix1 we are currently releasing fixes every week. September, if there are no blockers will have 4 releases. We do have another release left in August we can catch early next week if we have a fix by then. We will readjust milestone if that spans out.

JanusTida commented 1 year ago

For those, like me, who need this to do their job, I suggest you switch back to Omnisharp for now. This is the only thing that worked for me. So in other words stick with the current version but enable Omnisharp

image

(Makes me wonder if we even need something new instead of Omnisharp)

Rolling back to version 1+ might be more straight way

kent2cky commented 1 year ago

Jesus, I nearly ran mad. Realizing now that its a bug from the extension and not from my system. Thank God. Will try this.

For those, like me, who need this to do their job, I suggest you switch back to Omnisharp for now. This is the only thing that worked for me. So in other words stick with the current version but enable Omnisharp image (Makes me wonder if we even need something new instead of Omnisharp)

Rolling back to version 1+ might be more straight way

iwillspeak commented 1 year ago

Got the same error this morning. I solved it by rolling back to v2.0.376

Screenshot 2023-08-25 at 09 37 19
iagor1 commented 1 year ago

rollback works fine, thought was my pc, but was the new realase 😂. Just rollback to v2.0.376
if you dont know how to change the version by terminal, you can do it with the UI, just right click on the extension and click on
"Install Another Version..."

daveHylde commented 1 year ago

Same issue here, fixed with a +1 rollback. Frustrating to spend time on this - and MARVELOUS that this made it to prod from an official Microsoft extension for a Microsoft maintained programming language (C#) on a Microsoft tool (vscode). I'm on Ubuntu 23.04.

jasonmalinowski commented 1 year ago

For those are hitting this issue, can you provide a dump of the environment variables from your shell? For example, run printenv. Specifically we'd be looking at either your $HOME, $DOTNET_ROOT or $PATH.

bjornharrtell commented 1 year ago

I do not have a DOTNET_ROOT and HOME is just my /home/bjorn. Here is my dotnet --info output:

.NET SDK:
 Version:   7.0.110
 Commit:    ba920f88ac

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  23.04
 OS Platform: Linux
 RID:         ubuntu.23.04-x64
 Base Path:   /usr/lib/dotnet/sdk/7.0.110/

Host:
  Version:      7.0.10
  Architecture: x64
  Commit:       a6dbb800a4

.NET SDKs installed:
  6.0.121 [/usr/lib/dotnet/sdk]
  7.0.110 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.21 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.10 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.21 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.10 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found
jasonmalinowski commented 1 year ago

@bjornharrtell If you have a minute, are you able to upgrade back to the current latest and share the output of the C# output window?

Our current operating theory is some environment variables we expect to have absolute paths with are getting relative paths set, and that's not ending well.

briandoesdev commented 1 year ago

@jasonmalinowski I also do not have a 'DOTNET_ROOT' environment variable, my home is /home/briandoesdev.

As far as my C# output, I know you asked @bjornharrtell but mine looks like this at the current version:

Using dotnet configured on PATH
Dotnet path: ../lib/dotnet/dotnet
Activating C# standalone...
[Info  - 2:31:17 PM] [Program]Language server initialized
[Info  - 2:31:17 PM] [LanguageServerProjectSystem]Loaded MSBuild at /usr/lib/dotnet/sdk/7.0.110
[Error - 2:31:18 PM] [LanguageServerProjectSystem]Exception thrown while loading /home/briandoesdev/projects/test-project/test-project.csproj System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 174
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext.<>c.<.ctor>b__5_0(WatchedDirectory d) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext..ctor(ImmutableArray`1 watchedDirectories, LspFileChangeWatcher lspFileChangeWatcher) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 43
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.DelegatingFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/DelegatingFileChangeWatcher.cs:line 56
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.<>c__DisplayClass5_0.<.ctor>b__0() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 87
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.CreateReferenceAndStartWatchingFile(String fullFilePath, MetadataReferenceProperties properties) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 100
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.<>c__DisplayClass102_0.<OnBatchScopeDisposedMaybeAsync>b__0(SolutionChangeAccumulator solutionChanges) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 602
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass46_0.<ApplyBatchChangeToWorkspaceMaybeAsync>b__0(Solution oldSolution) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 262
   at Microsoft.CodeAnalysis.Workspace.<>c.<SetCurrentSolutionAsync>b__27_3(Solution oldSolution, ValueTuple`5 data) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 249
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync[TData](Boolean useAsync, TData data, Func`3 transformation, Boolean mayRaiseEvents, Action`3 onBeforeUpdate, Action`3 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 408
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync(Boolean useAsync, Func`2 transformation, Func`3 changeKind, Action`2 onBeforeUpdate, Action`2 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 244
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.ApplyBatchChangeToWorkspaceMaybeAsync(Boolean useAsync, Action`1 mutation) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 257
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.OnBatchScopeDisposedMaybeAsync(Boolean useAsync) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 520
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.BatchScope.DisposeAsync() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 493
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.UpdateWithNewProjectInfoAsync(ProjectFileInfo newProjectInfo) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 145
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.LoadOrReloadProjectAsync(String projectPath, ProjectBuildManager projectBuildManager, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 240
[Info  - 2:31:18 PM] [LanguageServerProjectSystem]Completed (re)load of all projects in 00:00:00.9151837
jasonmalinowski commented 1 year ago

@briandoesdev What is in your PATH? This is failing because the path we're ending up with in dotnet.exe is a relative path:

Using dotnet configured on PATH
Dotnet path: ../lib/dotnet/dotnet

And we're trying to figure out how that got there.

briandoesdev commented 1 year ago

@jasonmalinowski Here is my PATH:

PATH=/home/briandoesdev/.vscode-server/bin/6c3e3dba23e8fadc360aed75ce363ba185c49794/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/VMware/VMware Workstation/bin/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/bin:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Git/bin:/mnt/c/Program Files/Amazon/AWSCLIV2/:/mnt/c/Program Files/GitHub CLI/:/mnt/c/Program Files/CMake/bin:/mnt/c/Users/brian/AppData/Roaming/nvm:/mnt/c/Program Files/Go/bin:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Users/brian/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/brian/.dotnet/tools:/mnt/c/Users/brian/go/bin:/mnt/c/Users/brian/AppData/Local/Microsoft/WinGet/Packages/stedolan.jq_Microsoft.Winget.Source_8wekyb3d8bbwe:/mnt/c/Users/brian/.dotnet/tools:/mnt/c/Users/brian/apps:/mnt/c/Users/brian/go/bin
smfeest commented 1 year ago

Also experiencing this issue on Ubuntu 22.04.3 LTS.

This is my path:

/home/stephen/.gem/ruby/3.1.2/bin:/home/stephen/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/bin:/home/stephen/.rubies/ruby-3.1.2/bin:/home/stephen/.nvm/versions/node/v18.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/stephen/.dotnet/tools
smfeest commented 1 year ago

Interestingly when I downgrade to v2.0.376 (which appears to fix the issue), the C# output changes from:

Using dotnet configured on PATH
Dotnet path: ../lib/dotnet/dotnet
Activating C# standalone...
[Info  - 21:23:35] [Program]Language server initialized
[Info  - 21:23:35] [LanguageServerProjectSystem]Loaded MSBuild at /usr/lib/dotnet/sdk/7.0.110
[Info  - 21:23:35] [LanguageServerProjectSystem]Loading /home/stephen/projects/buttercup/Buttercup.sln...
[Error - 21:23:36] [LanguageServerProjectSystem]Exception thrown while loading /home/stephen/projects/buttercup/src/Buttercup.Email/Buttercup.Email.csproj System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 174
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext.<>c.<.ctor>b__5_0(WatchedDirectory d) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.FileChangeContext..ctor(ImmutableArray`1 watchedDirectories, LspFileChangeWatcher lspFileChangeWatcher) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 76
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.LspFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/LspFileChangeWatcher.cs:line 43
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.FileWatching.DelegatingFileChangeWatcher.CreateContext(WatchedDirectory[] watchedDirectories) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileWatching/DelegatingFileChangeWatcher.cs:line 56
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.<>c__DisplayClass5_0.<.ctor>b__0() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 87
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.CodeAnalysis.ProjectSystem.FileWatchedPortableExecutableReferenceFactory.CreateReferenceAndStartWatchingFile(String fullFilePath, MetadataReferenceProperties properties) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/FileWatchedPortableExecutableReferenceFactory.cs:line 100
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.<>c__DisplayClass102_0.<OnBatchScopeDisposedMaybeAsync>b__0(SolutionChangeAccumulator solutionChanges) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 602
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass46_0.<ApplyBatchChangeToWorkspaceMaybeAsync>b__0(Solution oldSolution) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 262
   at Microsoft.CodeAnalysis.Workspace.<>c.<SetCurrentSolutionAsync>b__27_3(Solution oldSolution, ValueTuple`5 data) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 249
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync[TData](Boolean useAsync, TData data, Func`3 transformation, Boolean mayRaiseEvents, Action`3 onBeforeUpdate, Action`3 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 408
   at Microsoft.CodeAnalysis.Workspace.SetCurrentSolutionAsync(Boolean useAsync, Func`2 transformation, Func`3 changeKind, Action`2 onBeforeUpdate, Action`2 onAfterUpdate, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Workspace.cs:line 244
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.ApplyBatchChangeToWorkspaceMaybeAsync(Boolean useAsync, Action`1 mutation) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs:line 257
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.OnBatchScopeDisposedMaybeAsync(Boolean useAsync) in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 520
   at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.BatchScope.DisposeAsync() in /_/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 493
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.UpdateWithNewProjectInfoAsync(ProjectFileInfo newProjectInfo) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 145
   at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.LoadOrReloadProjectAsync(String projectPath, ProjectBuildManager projectBuildManager, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 240
etc.

to

Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
Found dotnet version 7.0.10. Minimum required version is 7.0.100.
Dotnet path: /home/stephen/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/dotnet
Activating C# standalone...
[Info  - 21:13:34] [Program]Language server initialized
[Info  - 21:13:34] [LanguageServerProjectSystem]Loaded MSBuild at /usr/lib/dotnet/sdk/7.0.110
[Info  - 21:13:34] [LanguageServerProjectSystem]Loading /home/stephen/projects/buttercup/Buttercup.sln...
etc..

In other words, in the older version that works, the extension is falling back to what looks like its own copy of the runtime.

Setting the $DOTNET_ROOT env variable to /usr/lib/dotnet seems to have no effect.

jasonmalinowski commented 1 year ago

We've got a repro here now internally and working on a fix; thanks all for the reports!

mjrist commented 1 year ago

Looks like this is figured out now.

For anyone waiting on this release - looks like updating the dotnet.dotnetPath setting to the actual dotnet installation directory (/usr/lib/dotnet in my case) bypasses the issue.

Cosifne commented 1 year ago

Fix is checked in, it will be released next Monday.

Ghostbird commented 1 year ago

Thanks for fixing this quickly! Most stuff kept working, but the constant pop-ups of VSCode that I could not seem to disable, drove me mad. Or arguably just slightly madder.

Cosifne commented 1 year ago

Version 2.0.416 is released

moander commented 1 year ago

I still experience this on v2.0.436 when I use Go to definition.

[Error - 11:07:22 AM] [LanguageServerHost]System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 174
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.<TextSpanToLocationAsync>g__ConvertTextSpanToLocation|30_0(Document document, TextSpan span, Boolean isStale, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 464
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.TextSpanToLocationAsync(Document document, TextSpan textSpan, Boolean isStale, Nullable`1 context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 429
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.ComputeLocationAsync(Nullable`1 documentSpan, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 209
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.GenerateVSReferenceItemAsync(Int32 definitionId, Int32 id, Nullable`1 documentSpan, ImmutableDictionary`2 properties, ClassifiedTextElement definitionText, Glyph definitionGlyph, Nullable`1 symbolUsageInfo, Boolean isWrittenTo, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 194
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.OnDefinitionFoundAsync(DefinitionItem definition, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 118
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesProgressAdapter.OnDefinitionFoundAsync(SymbolGroup group, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs:line 110
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ReportGroupAsync(ISymbol symbol, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 175
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ReportGroupsAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 146
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
   at Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindReferencesAsync(ISymbol symbol, Solution solution, IStreamingFindReferencesProgress progress, IImmutableSet`1 documents, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindReferences_Current.cs:line 68
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 154
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 125
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 103
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindLiteralOrSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 65
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindAllReferencesHandler.HandleRequestAsync(ReferenceParams referenceParams, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindAllReferencesHandler.cs:line 68
   at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 176
[Error - 11:07:22 AM] Request textDocument/references failed.

  Message: Invalid URI: The format of the URI could not be determined.
  Code: -32000 

[object Object]
Cosifne commented 1 year ago

I still experience this on v2.0.436 when I use Go to definition.

[Error - 11:07:22 AM] [LanguageServerHost]System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.CreateAbsoluteUri(String absolutePath) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 174
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.<TextSpanToLocationAsync>g__ConvertTextSpanToLocation|30_0(Document document, TextSpan span, Boolean isStale, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 464
   at Microsoft.CodeAnalysis.LanguageServer.ProtocolConversions.TextSpanToLocationAsync(Document document, TextSpan textSpan, Boolean isStale, Nullable`1 context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs:line 429
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.ComputeLocationAsync(Nullable`1 documentSpan, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 209
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.GenerateVSReferenceItemAsync(Int32 definitionId, Int32 id, Nullable`1 documentSpan, ImmutableDictionary`2 properties, ClassifiedTextElement definitionText, Glyph definitionGlyph, Nullable`1 symbolUsageInfo, Boolean isWrittenTo, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 194
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindUsagesLSPContext.OnDefinitionFoundAsync(DefinitionItem definition, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindUsagesLSPContext.cs:line 118
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesProgressAdapter.OnDefinitionFoundAsync(SymbolGroup group, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs:line 110
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ReportGroupAsync(ISymbol symbol, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 175
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.ReportGroupsAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 146
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesAsync(ImmutableArray`1 symbols, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs:line 132
   at Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindReferencesAsync(ISymbol symbol, Solution solution, IStreamingFindReferencesProgress progress, IImmutableSet`1 documents, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_FindReferences_Current.cs:line 68
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, FindReferencesSearchOptions options, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 154
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 125
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 103
   at Microsoft.CodeAnalysis.FindUsages.AbstractFindUsagesService.FindLiteralOrSymbolReferencesAsync(IFindUsagesContext context, Document document, Int32 position, CancellationToken cancellationToken) in /_/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs:line 65
   at Microsoft.CodeAnalysis.LanguageServer.Handler.FindAllReferencesHandler.HandleRequestAsync(ReferenceParams referenceParams, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/References/FindAllReferencesHandler.cs:line 68
   at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 176
[Error - 11:07:22 AM] Request textDocument/references failed.

  Message: Invalid URI: The format of the URI could not be determined.
  Code: -32000 

[object Object]

Hi @moander This looks like a different issue, could you file a new issue with the repro steps & log?

jasonmalinowski commented 1 year ago

@moander Are you navigating to a symbol produced by a Roslyn source generator?

moander commented 1 year ago

@moander Are you navigating to a symbol produced by a Roslyn source generator?

Yes I am. Same issue on mac and wsl. It works fine with OmniSharp 🤷‍♂️

jasonmalinowski commented 1 year ago

@moander Alright that's a known limitation then with the v2.0 extension. The fix is on it's way in https://github.com/dotnet/vscode-csharp/pull/5858, although it'll still be another week or so since we've been prioritizing some other issues at the moment.

HugoCortell commented 12 months ago

Has a fix been released yet? I'm getting errors similar to this one and "Error: Unable to get working directory for project Miscellaneous Files"

jasonmalinowski commented 12 months ago

@HugoCortell The known fixes for 6218 (this bug) are out; if you're seeing something else please file a new bug.