-
Notifications
You must be signed in to change notification settings - Fork 676
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
Project load error with relative analyzer path #6584
Comments
Oh this is strange. I think what is happening here is actually this:
If that's causing MSBuild to stop doing further analysis, we might not have an actual design time build which would have correctly qualified this; we might be going back to fallback path which then isn't doing the absolute path correction. @dibarbet I wonder if this is indirectly fixed by dotnet/roslyn#70496 if that would mean we'd march along better in that case. |
Oh I see: we're not resolving it when we do have arguments, and this regressed since we weren't looking at that list previously. Fix coming shortly. |
@bkatz1 Fix should be out next week! |
Type: Bug
Issue Description
The language server fails to load Water.Core.csproj with the following error in the terminal:
When I remove the following lines from Water.Core.csproj, the error goes away and the language server loads the project successfully, but the project is no longer able to build because it is missing references.
Steps to Reproduce
Expected Behavior
Load all projects without error when the language server starts up.
Actual Behavior
Displays an error message and doesn't provide extension tools for the project that failed to load.
Logs
C# log
C# LSP Trace Logs
[Trace - 12:02:26 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] [04:02:26.939][End]initialize"
}
[Trace - 12:02:26 PM] Sending notification 'solution/open'.
Params: {
"solution": "file:///c:/Code/Water/Water/Water.sln"
}
[Trace - 12:02:26 PM] Sending request 'workspace/diagnostic - (1)'.
Params: {
"previousResultIds": [],
"partialResultToken": "1aa697b4-cc66-4d9d-99d5-c7396ae67242"
}
[Trace - 12:02:26 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] [04:02:26.944][Start]initialized"
}
[Trace - 12:02:26 PM] Received request 'client/registerCapability - (2)'.
Params: {
"registrations": [
{
"id": "baa2788d-5ec9-4ae1-a235-5d787305c856",
"method": "workspace/didChangeConfiguration"
}
]
}
[Trace - 12:02:26 PM] Sending response 'client/registerCapability - (2)'. Processing request took 1ms
No result returned.
[Trace - 12:02:26 PM] Received request 'workspace/configuration - (3)'.
Params: {
"items": [
{
"section": "csharp|symbol_search.dotnet_search_reference_assemblies"
},
{
"section": "csharp|implement_type.dotnet_insertion_behavior"
},
{
"section": "csharp|implement_type.dotnet_property_generation_behavior"
},
{
"section": "csharp|completion.dotnet_show_name_completion_suggestions"
},
{
"section": "csharp|completion.dotnet_provide_regex_completions"
},
{
"section": "csharp|completion.dotnet_show_completion_items_from_unimported_namespaces"
},
{
"section": "csharp|quick_info.dotnet_show_remarks_in_quick_info"
},
{
"section": "navigation.dotnet_navigate_to_decompiled_sources"
},
{
"section": "csharp|highlighting.dotnet_highlight_related_json_components"
},
{
"section": "csharp|highlighting.dotnet_highlight_related_regex_components"
},
{
"section": "csharp|inlay_hints.dotnet_enable_inlay_hints_for_parameters"
},
{
"section": "csharp|inlay_hints.dotnet_enable_inlay_hints_for_literal_parameters"
},
{
"section": "csharp|inlay_hints.dotnet_enable_inlay_hints_for_indexer_parameters"
},
{
"section": "csharp|inlay_hints.dotnet_enable_inlay_hints_for_object_creation_parameters"
},
{
"section": "csharp|inlay_hints.dotnet_enable_inlay_hints_for_other_parameters"
},
{
"section": "csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix"
},
{
"section": "csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent"
},
{
"section": "csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name"
},
{
"section": "csharp|inlay_hints.csharp_enable_inlay_hints_for_types"
},
{
"section": "csharp|inlay_hints.csharp_enable_inlay_hints_for_implicit_variable_types"
},
{
"section": "csharp|inlay_hints.csharp_enable_inlay_hints_for_lambda_parameter_types"
},
{
"section": "csharp|inlay_hints.csharp_enable_inlay_hints_for_implicit_object_creation"
},
{
"section": "csharp|code_style.formatting.indentation_and_spacing.tab_width"
},
{
"section": "csharp|code_style.formatting.indentation_and_spacing.indent_size"
},
{
"section": "csharp|code_style.formatting.indentation_and_spacing.indent_style"
},
{
"section": "csharp|code_style.formatting.new_line.end_of_line"
},
{
"section": "code_style.formatting.new_line.insert_final_newline"
},
{
"section": "csharp|background_analysis.dotnet_analyzer_diagnostics_scope"
},
{
"section": "csharp|background_analysis.dotnet_compiler_diagnostics_scope"
},
{
"section": "csharp|code_lens.dotnet_enable_references_code_lens"
},
{
"section": "csharp|code_lens.dotnet_enable_tests_code_lens"
},
{
"section": "projects.dotnet_binary_log_path"
}
]
}
[Trace - 12:02:26 PM] Sending response 'workspace/configuration - (3)'. Processing request took 1ms
Result: [
true,
null,
"withOtherMembersOfTheSameKind",
null,
"preferThrowingProperties",
null,
"true",
null,
"true",
null,
true,
null,
"true",
null,
"true",
"true",
null,
"true",
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
false,
null,
"4",
null,
"4",
null,
"space",
null,
"auto",
null,
false,
"openFiles",
null,
"openFiles",
null,
true,
null,
true,
null,
null
]
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] [04:02:27.092][End]initialized"
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] [04:02:27.095][Start]solution/open"
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 3,
"message": "[LanguageServerProjectSystem] Loading c:\Code\Water\Water\Water.sln..."
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] [04:02:27.130][Start]workspace/diagnostic"
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] PublicWorkspacePullDiagnosticsHandler(category: , source: ) started getting diagnostics"
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 19804] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.Program[0]"
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 19804] Message from Process: RPC channel started."
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 19804] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.BuildHost[0]"
}
[Trace - 12:02:27 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 19804] Message from Process: Registered MSBuild instance at C:\Program Files\dotnet\sdk\7.0.400"
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.BuildHostProcessManager] Choosing a build host of type NetFramework for c:\Code\Water\Water\Water.Core.Tests\Water.Core.Tests.csproj."
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.BuildHostProcessManager] Choosing a build host of type NetFramework for c:\Code\Water\Water\Water\Water.csproj."
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.BuildHostProcessManager] Choosing a build host of type NetFramework for c:\Code\Water\Water\Water.Core\Water.Core.csproj."
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.Program[0]"
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: RPC channel started."
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25252] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.BuildHost[0]"
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25252] Message from Process: Registered MSBuild instance at C:\Program Files\dotnet\sdk\7.0.400"
}
[Trace - 12:02:28 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25252] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.BuildHost[0]"
}
[Log Truncated]
[Trace - 12:02:29 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: Loading c:\Code\Water\Water\Water.Core.Tests\Water.Core.Tests.csproj"
}
[Trace - 12:02:29 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.BuildHost[0]"
}
[Trace - 12:02:29 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: Loading c:\Code\Water\Water\Water\Water.csproj"
}
[Trace - 12:02:29 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: info: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.BuildHost[0]"
}
[Trace - 12:02:29 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[BuildHost PID 25944] Message from Process: Loading c:\Code\Water\Water\Water.Core\Water.Core.csproj"
}
[Trace - 12:02:30 PM] Received request 'client/registerCapability - (5)'.
Params: {
"registrations": [
{
"id": "4ed88f6b-e8a2-43e2-87cb-779d3eb78015",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": {
"baseUri": "file:///c:/Code/Water/Water/Water.Mobile.Lib/",
"pattern": "**/*.cs"
}
}
]
}
}
]
}
[Log Truncated]
[Trace - 12:02:33 PM] Received request 'client/registerCapability - (461)'.
Params: {
"registrations": [
{
"id": "c60796aa-fd86-470b-88d9-35b0b63fbe4f",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": {
"baseUri": "file:///c:/Code/Water/Water/Water.Core",
"pattern": "Water.Core.csproj"
}
}
]
}
}
]
}
[Trace - 12:02:33 PM] Sending response 'client/registerCapability - (461)'. Processing request took 0ms
No result returned.
[Log Truncated]
[Trace - 12:02:33 PM] Received notification 'window/logMessage'.
Params: {
"type": 1,
"message": "[LanguageServerProjectSystem] Exception thrown while loading c:\Code\Water\Water\Water.Core\Water.Core.csproj System.ArgumentException: Absolute path expected. (Parameter 'fullPath')\r\n at Roslyn.Utilities.CompilerPathUtilities.RequireAbsolutePath(String path, String argumentName) in //src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/CompilerUtilities/CompilerPathUtilities.cs:line 21\r\n at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProject.AddAnalyzerReference(String fullPath) in //src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs:line 883\r\n at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.b__14_4(CommandLineAnalyzerReference reference) in //src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 131\r\n at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.g__UpdateProjectSystemProjectCollection|14_12[T](IEnumerable
1 loadedCollection, IEnumerable
1 oldLoadedCollection, IEqualityComparer1 comparer, Action
1 addItem, Action`1 removeItem) in //src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 177\r\n at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.UpdateWithNewProjectInfoAsync(ProjectFileInfo newProjectInfo) in //src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 127\r\n at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LoadedProject.UpdateWithNewProjectInfoAsync(ProjectFileInfo newProjectInfo) in //src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs:line 161\r\n at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.LoadOrReloadProjectAsync(ProjectToLoad projectToLoad, BuildHostProcessManager buildHostProcessManager, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 276"}
[Trace - 12:02:33 PM] Received request 'client/registerCapability - (719)'.
Params: {
"registrations": [
{
"id": "2a423a6b-e2e6-4be0-ab7c-9f4164df7b67",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": {
"baseUri": "file:///c:/Code/Water/Water/packages/Microsoft.Bcl.AsyncInterfaces.7.0.0/lib/net462",
"pattern": "Microsoft.Bcl.AsyncInterfaces.dll"
}
}
]
}
}
]
}
[Trace - 12:02:33 PM] Sending response 'client/registerCapability - (719)'. Processing request took 0ms
No result returned.
[Trace - 12:02:33 PM] Received notification 'window/_roslyn_showToast'.
Params: {
"messageType": 1,
"message": "There were problems loading project Water.Core.csproj. See log for details.",
"commands": [
{
"title": "Show C# logs",
"command": "csharp.showOutputWindow"
}
]
}
[Trace - 12:02:33 PM] Received request 'client/registerCapability - (722)'.
Params: {
"registrations": [
{
"id": "33f834a8-3155-41b6-9da2-957b8334bcc8",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": {
"baseUri": "file:///c:/Code/Water/Water/packages/Microsoft.ReportingServices.ReportViewerControl.WebForms.150.1586.0/lib/net40",
"pattern": "Microsoft.ReportViewer.Common.dll"
}
}
]
}
}
]
}
[Log Truncated]
[Trace - 12:02:42 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] [04:02:42.843][Start]workspace/diagnostic"
}
[Trace - 12:02:42 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] PublicWorkspacePullDiagnosticsHandler(category: , source: ) started getting diagnostics"
}
[Trace - 12:02:42 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] previousResults.Length=0"
}
[Trace - 12:02:42 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "[LanguageServerHost] Processing 0 documents"
}
Environment information
VSCode version: 1.83.1
C# Extension: 2.7.25
Using OmniSharp: false
Dotnet Information
.NET SDK: Version: 7.0.400 Commit: 73bf45718dRuntime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.400\
Host:
Version: 7.0.12
Architecture: x64
Commit: 4a824ef37c
.NET SDKs installed:
5.0.408 [C:\Program Files\dotnet\sdk]
7.0.112 [C:\Program Files\dotnet\sdk]
7.0.400 [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 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.12 [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 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.12 [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
Visual Studio Code Extensions
Extension version: 2.7.25
VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:48:05.904Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: