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

"Unexpected error loading file <pathTo>.csproj" : "Could not load file or assembly" : 8.0 Preview #60

Closed
vindicatorr opened this issue Aug 17, 2023 · 10 comments

Comments

@vindicatorr
Copy link

This issue has me completely vexxed...
I had copied the 8.0 preview sdk files to my dotnet folder /opt/dotnet/, and saw this extension no longer giving me autocompletion.
For a sanity-check, I:

  1. Installed vscode-insiders (instead of vscode-oss) (still failed)
  2. Futzed with the permissions which should've been fine (though I learned chmod using o+rX or o=rX would set 'x' permission on files too if 'u' also had 'x') (still failed)
  3. Moved the dotnet folder and replaced it with only the 8.0 preview (instead of 6.0, 7.0, 8.0 preview) (this worked)
  4. Copying 7.0 and 8.0 preview back in (still failed)
  5. Rm'ing all 7.0 related files ($ find /opt/dotnet -name "*7.0*") from the dotnet path (but NOT removing 7.0 references found in the 8.0 sdk) (this worked)

So it's like there's some conflict having 7.0 and 8.0 sdks together which makes no sense.

MSBuild Language Server
Failing:

Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was "OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult"
Finished: Routing Request (0) "initialize" in 39ms
Finding descriptor for "initialized"
Finding descriptor for "workspace/didChangeConfiguration"
Starting: Routing Notification "initialized"
Finished: Routing Notification "initialized" in 8ms
Starting: Routing Notification "workspace/didChangeConfiguration"
Converting params for Notification "workspace/didChangeConfiguration" to "MSBuildProjectTools.LanguageServer.CustomProtocol.DidChangeConfigurationObjectParams"
Finished: Routing Notification "workspace/didChangeConfiguration" in 56ms
Finding descriptor for "textDocument/didOpen"
Created attribute "xml::file:///<pathTo>.csproj"
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSyncHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
Starting: Routing Notification "textDocument/didOpen"
Converting params for Notification "textDocument/didOpen" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DidOpenTextDocumentParams"
[Info  - 5:48:52 PM] Using MSBuild engine v8.0.100 from "/opt/dotnet/sdk/8.0.100-preview.7.23376.3/".
Language server initialised by client.
Finding descriptor for "textDocument/documentSymbol"
Found attributes 1, ["msbuild::file:///<pathTo>.csproj"]
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
[Error - 5:48:52 PM] Unexpected error loading file "/<pathTo>.csproj".
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at async Task MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.Load(CancellationToken cancellationToken)
   at void System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.Load(CancellationToken cancellationToken)
   at Task MSBuildProjectTools.LanguageServer.Documents.MasterProjectDocument.<>n__0(?)
   at async Task MSBuildProjectTools.LanguageServer.Documents.MasterProjectDocument.Load(CancellationToken cancellationToken) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\MasterProjectDocument.cs:line 131
   at async Task<ProjectDocument> MSBuildProjectTools.LanguageServer.Documents.Workspace.GetProjectDocument(Uri documentUri, bool reload) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\Workspace.cs:line 226

Working:

Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was "OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult"
Finished: Routing Request (0) "initialize" in 38ms
Finding descriptor for "initialized"
Finding descriptor for "workspace/didChangeConfiguration"
Starting: Routing Notification "initialized"
Finished: Routing Notification "initialized" in 3ms
Starting: Routing Notification "workspace/didChangeConfiguration"
Converting params for Notification "workspace/didChangeConfiguration" to "MSBuildProjectTools.LanguageServer.CustomProtocol.DidChangeConfigurationObjectParams"
Finished: Routing Notification "workspace/didChangeConfiguration" in 42ms
Finding descriptor for "textDocument/didOpen"
Created attribute "xml::file:///<pathTo>.csproj"
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSyncHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
Starting: Routing Notification "textDocument/didOpen"
Converting params for Notification "textDocument/didOpen" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DidOpenTextDocumentParams"
Language server initialised by client.
Finding descriptor for "textDocument/documentSymbol"
[Info  - 6:10:36 PM] Using MSBuild engine v8.0.100 from "/opt/dotnet/sdk/8.0.100-preview.7.23376.3/".
Found attributes 1, ["msbuild::file:///<pathTo>.csproj"]
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
[Info  - 6:10:38 PM] 1 package sources configured for project "/<pathTo>.csproj".
[Info  - 6:10:38 PM]   Locally-configured package source "nuget.org" (v3) => https://api.nuget.org/v3/index.json
@tintoy
Copy link
Owner

tintoy commented Aug 17, 2023

As a general rule I've found that SDKs using newer versions of the runtime than the version that the language server was built against don't really work correctly. It's a side-effect of us having to load and use the MSBuild library from the target version of the SDK (which was built against a newer version of the runtime than the one running the language-server host.

@vindicatorr
Copy link
Author

vindicatorr commented Aug 17, 2023

The oddity though is that it DOES work when it is just 8.0.
For whatever insane reason, it fails when I have both 7.0 and 8.0. This, I cannot explain.

EDIT0: Yeah, it's something to do with 8.0 being side-by-side with any other sdk:
6.0 works
6.0+7.0 works
6.0+7.0+8.0 fails
8.0 works
Weird stuff for sure. I don't know if I just leave this here, or report to the sdk repo, or leave it to you to report it should it be a valid issue...

@tintoy
Copy link
Owner

tintoy commented Aug 18, 2023

Yeah that is pretty odd; there are environment variables you can set (see MSBuild unit tests) that may help with additional diagnostics...

@vindicatorr
Copy link
Author

vindicatorr commented Aug 19, 2023

I was going to ask for more guidance relating to the "unit tests" env vars before coming across some more findings.

First was how vscode didn't use the .bashrc/.profile env vars when launched from KDE's launcher.
I had to either launch from the terminal or manually add DOTNET_ROOT to the vscode launcher properties.
This was solely to get your extension to even build(/launch) in vscode (it built fine in the terminal).

I couldn't run the tests launch option in vscode for some reason:

Error: Cannot find module '/<pathTo>/msbuild-project-tools-vscode/out/test'
Require stack:
- /<pathTo>/VSCode-linux-x64/resources/app/out/vs/loader.js
- /<pathTo>/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /<pathTo>/VSCode-linux-x64/resources/app/out/bootstrap-fork.js
- 
	at Module._resolveFilename (/<pathTo>/msbuild-project-tools-vscode/lib/internal/modules/cjs/loader.js:963:15)
	at o._resolveFilename (/<pathTo>/msbuild-project-tools-vscode/lib/electron/js2c/utility_init.js:2:2994)
	at Module._load (/<pathTo>/msbuild-project-tools-vscode/lib/internal/modules/cjs/loader.js:811:27)
	at f._load (/<pathTo>/msbuild-project-tools-vscode/lib/electron/js2c/asar_bundle.js:2:13330)
	at Module._load (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85014:33)
	at Function.load (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:84857:41)
	at Function.load [as _load] (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:42691:37)
	at Module.require (/<pathTo>/msbuild-project-tools-vscode/lib/internal/modules/cjs/loader.js:1035:19)
	at require (/<pathTo>/msbuild-project-tools-vscode/lib/internal/modules/cjs/helpers.js:102:18)
	at Function.nodeRequire [as __$__nodeRequire] (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/loader.js:1029:12)
	at $sbc.rb (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:84924:29)
	at $sbc.mb (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:77335:43)
	at $sbc.$extensionTestsExecute (/<pathTo>/VSCode-linux-x64/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:77322:35) {code: 'MODULE_NOT_FOUND', requireStack: Array(4), stack: 'Error: Cannot find module '/<pathTo>/api/node/extensionHostProcess.js:77322:35)', message: 'Cannot find module '/<pathTo>/resources/app/out/bootstrap-fork.js
- '}
No debugger available, can not send 'variables'

... except the path DOES exist:

$ find ./out/test
./out/test
./out/test/extension
./out/test/extension/extension.test.js.map
./out/test/extension/extension.test.js
./out/test/extension/index.js.map
./out/test/extension/index.js

... so I tried in the terminal using $ dotnet test ./lib/server/, and that passed completely.

Running "Launch Extension" opens a new window and automatically starts downloading 6.0 which I didn't want to happen since I already have it installed, so I closed that.

I don't know if you can point me a little more directly to where I should be looking/trying with regard to the "env vars" for "MSBuild unit tests".

EDIT0:
To stop the automatic .net download, I added to "dotnetAcquisitionExtension.existingDotnetPath":

        {
            "extensionId": "tintoy.msbuild-project-tools",
            "path": "/opt/dotnet/dotnet"
        }

... but it is left with Initialising MSBuild project tools... after installing the built vsix.

EDIT1:
After closing vscode, and re-opening, the installed vsix was no longer there. When I added it again, there was no hang, but no message or LSP either.
I even added:

    "msbuildProjectTools.logging.level": "Verbose",
    "msbuildProjectTools.logging.trace": true

... and still have no LSP nor MPT output.
In Extension Host, I do see: [info] ExtensionService#_doActivateExtension tintoy.msbuild-project-tools, startup: false, activationEvent: 'onLanguage:xml' after I install it again. (I have to keep installing it for some reason)

@tintoy
Copy link
Owner

tintoy commented Aug 19, 2023

Sorry, am away for the weekend or I'd have sent you a link to the code 🙂

I'll have a look for the code in question when I get home tomorrow afternoon.

@tintoy
Copy link
Owner

tintoy commented Aug 19, 2023

@tintoy
Copy link
Owner

tintoy commented Aug 19, 2023

(see line 66)

@vindicatorr
Copy link
Author

Thanks, I was hopeful, but setting MSBUILD_PROJECT_TOOLS_DOTNET_HOST_DIAGNOSTICS=1 in the terminal to start vscode, doesn't seem to give much (any extra?) info:

Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was "OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult"
Finished: Routing Request (0) "initialize" in 26ms
Finding descriptor for "initialized"
Finding descriptor for "workspace/didChangeConfiguration"
Starting: Routing Notification "initialized"
Finished: Routing Notification "initialized" in 22ms
Starting: Routing Notification "workspace/didChangeConfiguration"
Converting params for Notification "workspace/didChangeConfiguration" to "MSBuildProjectTools.LanguageServer.CustomProtocol.DidChangeConfigurationObjectParams"
Finished: Routing Notification "workspace/didChangeConfiguration" in 62ms
Finding descriptor for "textDocument/didOpen"
Created attribute "xml::file:///<pathTo>.csproj"
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSyncHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
Starting: Routing Notification "textDocument/didOpen"
Converting params for Notification "textDocument/didOpen" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DidOpenTextDocumentParams"
[Info  - 9:44:15 AM] Using MSBuild engine v8.0.100 from "/opt/dotnet/sdk/8.0.100-preview.7.23376.3/".
Language server initialised by client.
Finding descriptor for "textDocument/documentSymbol"
Found attributes 1, ["msbuild::file:///<pathTo>.csproj"]
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
[Error - 9:44:15 AM] Unexpected error loading file "/<pathTo>.csproj".
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at async Task MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.Load(CancellationToken cancellationToken)
   at void System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.Load(CancellationToken cancellationToken)
   at Task MSBuildProjectTools.LanguageServer.Documents.MasterProjectDocument.<>n__0(?)
   at async Task MSBuildProjectTools.LanguageServer.Documents.MasterProjectDocument.Load(CancellationToken cancellationToken) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\MasterProjectDocument.cs:line 131
   at async Task<ProjectDocument> MSBuildProjectTools.LanguageServer.Documents.Workspace.GetProjectDocument(Uri documentUri, bool reload) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\Workspace.cs:line 226
[Warn  - 9:44:15 AM] Failed to load project file "/<pathTo>.csproj".
Finished: Routing Notification "textDocument/didOpen" in 109ms
Starting: Routing Request (1) "textDocument/documentSymbol"
Converting params for Request (1) "textDocument/documentSymbol" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams"
[Error - 9:44:15 AM] Unhandled exception in OnDocumentSymbols.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at async Task<DocumentSymbolInformationContainer> MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler.OnDocumentSymbols(DocumentSymbolParams parameters, CancellationToken cancellationToken)
   at void System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<DocumentSymbolInformationContainer> MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler.OnDocumentSymbols(DocumentSymbolParams parameters, CancellationToken cancellationToken)
   at async Task<DocumentSymbolInformationContainer> MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler.OmniSharp.Extensions.JsonRpc.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolInformationContainer>.Handle(?) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Handlers\DocumentSymbolHandler.cs:line 233
Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolInformationContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was null
Finished: Routing Request (1) "textDocument/documentSymbol" in 7ms

Since you showed me that one, I hunted for other GetEnvironmentVariable, and added:
MSBUILD_PROJECT_TOOLS_VERBOSE_LOGGING=1 and MSBUILD_PROJECT_TOOLS_LOG_FILE=<path>... !!!! OH mommy! We hit the payload for "diagnostics". The file is like 600K!

Hmm, it may not be all that helpful though. The main messaging looks to be the same at the end, and all of the stuff before it just leads up to it, but shows it's finding the System.Runtime:

...
Adding runtime assets
...
System.Runtime.dll assemblyVersion=8.0.0.0 fileVersion=8.0.23.37506
...
Entry 38 for asset name: System.Runtime, relpath: System.Runtime.dll, assemblyVersion 8.0.0.0, fileVersion 8.0.23.37506
...
Processing package System.Runtime/4.3.0
...
Reconciling library System.Runtime/4.3.0
  No assets for library System.Runtime/4.3.0
...
Processing TPA for deps entry [Microsoft.NETCore.App.Runtime.linux-x64, 8.0.0-preview.7.23375.6, System.Runtime.dll] with fx level: 1
  Using probe config: type=app
    Skipping... not app asset
  Using probe config: type=framework dir=[/opt/dotnet/shared/Microsoft.NETCore.App/8.0.0-preview.7.23375.6] fx_level=1
    Local path query /opt/dotnet/shared/Microsoft.NETCore.App/8.0.0-preview.7.23375.6/System.Runtime.dll (skipped file existence check)
    Probed deps json and matched '/opt/dotnet/shared/Microsoft.NETCore.App/8.0.0-preview.7.23375.6/System.Runtime.dll'
Adding tpa entry: /opt/dotnet/shared/Microsoft.NETCore.App/8.0.0-preview.7.23375.6/System.Runtime.dll, AssemblyVersion: 8.0.0.0, FileVersion: 8.0.23.37506
...
//more repeat from above
...
2023-08-19 09:54:46.746 -05:00 [Verbose/] Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
2023-08-19 09:54:46.738 -05:00 [Error/OnDidOpenTextDocument] Unexpected error loading file "/<pathTo>.csproj".
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at async Task MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.Load(CancellationToken cancellationToken)
   at void System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.Load(CancellationToken cancellationToken)
   at Task MSBuildProjectTools.LanguageServer.Documents.MasterProjectDocument.<>n__0(?)
   at async Task MSBuildProjectTools.LanguageServer.Documents.MasterProjectDocument.Load(CancellationToken cancellationToken) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\MasterProjectDocument.cs:line 131
   at async Task<ProjectDocument> MSBuildProjectTools.LanguageServer.Documents.Workspace.GetProjectDocument(Uri documentUri, bool reload) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\Workspace.cs:line 226
2023-08-19 09:54:46.786 -05:00 [Warning/OnDidOpenTextDocument] Failed to load project file "/<pathTo>.csproj".
2023-08-19 09:54:46.787 -05:00 [Debug/] Finished: Routing Notification "textDocument/didOpen" in 74ms
2023-08-19 09:54:46.787 -05:00 [Debug/] Starting: Routing Request (1) "textDocument/documentSymbol"
2023-08-19 09:54:46.787 -05:00 [Debug/] Converting params for Request (1) "textDocument/documentSymbol" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams"
2023-08-19 09:54:46.789 -05:00 [Error/OnDocumentSymbols] Unhandled exception in OnDocumentSymbols.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at async Task<DocumentSymbolInformationContainer> MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler.OnDocumentSymbols(DocumentSymbolParams parameters, CancellationToken cancellationToken)
   at void System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<DocumentSymbolInformationContainer> MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler.OnDocumentSymbols(DocumentSymbolParams parameters, CancellationToken cancellationToken)
   at async Task<DocumentSymbolInformationContainer> MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler.OmniSharp.Extensions.JsonRpc.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolInformationContainer>.Handle(?) in /<pathTo>/D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Handlers\DocumentSymbolHandler.cs:line 233
2023-08-19 09:54:46.791 -05:00 [Debug/] Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolInformationContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
2023-08-19 09:54:46.791 -05:00 [Debug/] Response value was null
2023-08-19 09:54:46.791 -05:00 [Debug/] Finished: Routing Request (1) "textDocument/documentSymbol" in 3ms
2023-08-19 09:55:26.805 -05:00 [Debug/] Finding descriptor for "shutdown"
2023-08-19 09:55:26.808 -05:00 [Debug/] Starting: Routing Request (2) "shutdown"
2023-08-19 09:55:26.808 -05:00 [Debug/] Converting params for Request (2) "shutdown" to "System.Object"

No rush or anything. Truly, enjoy your weekend. I'll hear from ya when I hear from ya, and I don't want to hear from ya when you should be enjoying your weekend.

@DoctorKrolic
Copy link
Collaborator

@vindicatorr Can you please check this on a GA version of .NET 8? I have .NET 6, 7 and 8 currently installed side by side and the error is gone. If the issue is resolved for you as well, we can close this issue

@vindicatorr
Copy link
Author

Same here. Just updated to the final 8.0 release (alongside the other sdk versions) and encountered my other issue referenced above, updated vscode-csharp, and everything's looking good again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants