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

Failed to start the MSBuild language server after updating to v0.5.0 #137

Closed
glen-84 opened this issue Nov 23, 2023 · 19 comments · Fixed by #138
Closed

Failed to start the MSBuild language server after updating to v0.5.0 #137

glen-84 opened this issue Nov 23, 2023 · 19 comments · Fixed by #138

Comments

@glen-84
Copy link

glen-84 commented Nov 23, 2023

Starting MSBuild language service...
Failed to start the MSBuild language server.
Error: Command failed: "/home/glen/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~x64/dotnet" "/home/glen/.vscode-server/extensions/tintoy.msbuild-project-tools-0.5.0/language-server/MSBuildProjectTools.LanguageServer.Host.dll" --probe
System.InvalidOperationException: The 'dotnet --version' command did not return any output.
   at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.ParseDotNetVersionOutput(TextReader dotnetVersionOutput)
   at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.GetCurrent(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Utilities.MSBuildHelper.DiscoverMSBuildEngine(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Program.Main()

System.InvalidOperationException: The 'dotnet --version' command did not return any output.
   at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.ParseDotNetVersionOutput(TextReader dotnetVersionOutput)
   at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.GetCurrent(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Utilities.MSBuildHelper.DiscoverMSBuildEngine(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Program.Main()

WSL (Debian) on Windows 11.

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

Thanks - will investigate shortly! Can you post the output of dotnet --info?

@AdamCoulterOz
Copy link

AdamCoulterOz commented Nov 23, 2023

same here (on macOS 14.1.1):

% "/Users/adam/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~arm64/dotnet" \
  "/Users/adam/.vscode/extensions/tintoy.msbuild-project-tools-0.5.0/language-server/MSBuildProjectTools.LanguageServer.Host.dll" \
  --probe

System.InvalidOperationException: The 'dotnet --version' command did not return any output.
   at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.ParseDotNetVersionOutput(TextReader dotnetVersionOutput)
   at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.GetCurrent(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Utilities.MSBuildHelper.DiscoverMSBuildEngine(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Program.Main()

For dotnet --info

% "/Users/adam/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~arm64/dotnet" \
  --info

global.json file:
  Not found

Host:
  Version:      6.0.25
  Architecture: arm64
  Commit:       492abbeef0

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.NETCore.App 6.0.25 [/Users/adam/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~arm64/shared/Microsoft.NETCore.App]

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

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

@glen-84
Copy link
Author

glen-84 commented Nov 23, 2023

Thanks - will investigate shortly! Can you post the output of dotnet --info?

/home/glen/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~x64/dotnet --info

global.json file:
  /home/glen/projects/api/global.json

Host:
  Version:      6.0.25
  Architecture: x64
  Commit:       492abbeef0

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.NETCore.App 6.0.25 [/home/glen/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~x64/shared/Microsoft.NETCore.App]

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

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

@glen-84
Copy link
Author

glen-84 commented Nov 23, 2023

/home/glen/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.25~x64/dotnet --version
The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application '--version' does not exist.
  * You intended to execute a .NET SDK command:
      A compatible .NET SDK was not found.

Requested SDK version: 8.0.100
global.json file: /home/glen/projects/api/global.json

Installed SDKs:
No .NET SDKs were found.

Install the [8.0.100] .NET SDK or update [/home/glen/projects/api/global.json] to match an installed SDK.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

@Martin521
Copy link

Same here (Windows11/WSL2, Dev Containers)

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

Just for now (so we don't affect anyone else while we investigate), I have rolled back to the previous version (v0.4.9) by publishing it as v0.5.1. The new package should appear in the gallery soon.

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

@AdamCoulterOz and @glen-84 - it seems to indicate that there are no .NET SDKs installed on your system, is that correct? Or is this just a result of running it from that location?

If you remove the path prefix from the dotnet command, do you get different output?

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

@DoctorKrolic - from the output above, it seems that the .NET runtime acquired via the vscode-dotnet-runtime extension is isolated and does not see any of the .NET SDKs installed the regular way...

Is this the behaviour that you've seen while working with it?

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

@Martin521 - do you have the .NET SDK installed your dev container?

@glen-84
Copy link
Author

glen-84 commented Nov 23, 2023

@AdamCoulterOz and @glen-84 - it seems to indicate that there are no .NET SDKs installed on your system, is that correct? Or is this just a result of running it from that location?

The latter. (I have SDKs installed)

If you remove the path prefix from the dotnet command, do you get different output?

Yes.

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

@glen-84 - ok, thanks, it sounds like we need to find a way to locate the global dotnet executable and associated SDKs after the extension has been loaded by the isolated runtime.

@glen-84
Copy link
Author

glen-84 commented Nov 23, 2023

Also, not sure why it installs .NET 6.

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

Also, not sure why it installs .NET 6.

I think that's because it's the version that the language server was built against.

@Martin521
Copy link

@Martin521 - do you have the .NET SDK installed your dev container?

Yes, 8.0.0-rc.1.23419.4
(Config here)

@AdamCoulterOz
Copy link

I've got 8.0.100 installed

@DoctorKrolic
Copy link
Collaborator

I made a PR which sould resolve this. I described what exactly happened and why we were not able to catch this during development there. In the meantime I apologize for the inconvenience. There are only 2 of us maintaining the extension, so we don't have enough resources to cover all cases when testing. Thanks for patience and the contribution, your logs and other info were pretty useful!

@tintoy
Copy link
Owner

tintoy commented Nov 23, 2023

Yeah, sorry I should have been more thorough when testing the new changes; I don’t have a Mac anymore but I normally try to smoke-test each release in WSL and dev containers before publishing.

(I’ve spent too much time this month fighting kops and terraform so I’ve been a little distracted 😂)

@Martin521
Copy link

Thanks to both of you for providing this great extension and for the quick reaction!

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

Successfully merging a pull request may close this issue.

5 participants