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 .NET 6 upgrade) #90

Closed
solrevdev opened this issue Nov 19, 2021 · 11 comments
Closed

Comments

@solrevdev
Copy link

Hi,

When my version of .NET Core upgraded from .NET 5 to .NET 6 my extension started throwing the following error.

I think the issue is that when homebrew runs the .NET upgrade it actually uninstalls the previous SDK before installing the current one so that you don't end up with hundreds of .NET's lying around but that does mean that I know longer have the .NET 5 SDK installed just .NET 6.

Hope that makes sense and do shout if you need any more info or if you point me to the right place, I'm happy to have a stab at fixing it!

Thanks
John

Error Message:

Starting MSBuild language service...
Failed to start the MSBuild language server.
Error: Command failed: "/usr/local/bin/dotnet" "/Users/solrevdev/.vscode-insiders/extensions/tintoy.msbuild-project-tools-0.3.15/out/language-server/MSBuildProjectTools.LanguageServer.Host.dll" --probe
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
  - The following frameworks were found:
      6.0.0 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=osx.11.0-x64

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
  - The following frameworks were found:
      6.0.0 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=osx.11.0-x64

Extension Version:

tintoy.msbuild-project-tools-0.3.15

VS Code Insiders:

1.63.0-insider
bedf867b5b02c1c800fbaf4d6ce09cefbafa1592
x64

.NET

▲ ~ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  11.6
 OS Platform: Darwin
 RID:         osx.11.0-x64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.100/

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  6.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

▲ ~ dotnet --list-sdks
6.0.100 [/usr/local/share/dotnet/sdk]

▲ ~ dotnet --version
6.0.100

MacOS:

OS: macOS 11.6 20G165 x86_64
Host: Macmini7,1
Kernel: 20.6.0
Uptime: 4 days, 9 mins
Packages: 312 (brew)
Shell: zsh 5.8
Resolution: 2560x1440
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue (Light)
Terminal: iTerm2
Terminal Font: AnonymicePowerline 14
CPU: Intel i5-4278U (4) @ 2.60GHz
GPU: Intel Iris
Memory: 9560MiB / 16384MiB
@tintoy
Copy link
Owner

tintoy commented Nov 19, 2021

You don’t need the 5.x SDK, just the 5.x runtime. Can you try the VSIX from this build to see if it works for you? I just realised I forgot to publish it to the VS gallery.

https://github.com/tintoy/msbuild-project-tools-vscode/releases/tag/v0.4.1

It’s the new build that targets .net 6.

@tintoy
Copy link
Owner

tintoy commented Nov 19, 2021

(sorry about that!)

@solrevdev
Copy link
Author

Bingo!

Yep, that works great thank you. 🙏

I ran Extensions: Install from VSIX... from VS Code Insiders command pallete, then when I view the MSBuild Project Tools logs via the Output window I get this lovely message

Starting MSBuild language service...
MSBuild language service is running.

@tintoy
Copy link
Owner

tintoy commented Nov 19, 2021

Thanks! I’ll get that new package published :)

@pm4rcin
Copy link
Contributor

pm4rcin commented Jan 9, 2022

@tintoy could you also publish on open-vsx? :)

@tintoy
Copy link
Owner

tintoy commented Jan 10, 2022

Sure, will do :)

@baronfel
Copy link

baronfel commented Jan 11, 2022

@tintoy in addition to the 5.x Runtime, you could also spawn the .NET executable with the --roll-forward LatestMajor flag, which attempts to run the binary on the latest Runtime the user has installed. OR you can set <RollForward>LatestMajor</RollForward> in the project file, which will add the flag to the deps.json file and tell the runtime to do this as well. This is what I do in Ionide for the the FsAutoComplete F# Language Server, since it still targets the net5.0 TFM.

@tintoy
Copy link
Owner

tintoy commented Jan 12, 2022

@tintoy could you also publish on open-vsx? :)

Sorry, I haven't had time to do this yet (first week at a new job and things are super-busy!). I'll try to get it done tonight :)

@tintoy
Copy link
Owner

tintoy commented Jan 12, 2022

@pm4rcin - now also published to open-vsx :)

@pm4rcin
Copy link
Contributor

pm4rcin commented Feb 8, 2022

@tintoy I think it could be closed.

@tintoy
Copy link
Owner

tintoy commented Feb 8, 2022

Thanks! Sorry, this one kinda fell through the cracks :)

@tintoy tintoy closed this as completed Feb 8, 2022
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

4 participants