-
Notifications
You must be signed in to change notification settings - Fork 17
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
Improve error message for failed language server startup #73
Comments
Unclear if it's related, but after installing .NET 5.0.102, in that same project I now see:
My {
"sdk": {
"rollForward": "latestFeature",
"version": "3.1.405"
}
}
I see the SDK is there, but, no, there's no I'm not sure what I should do at this point to re-enable the MSBuild language service. |
Yeah this is what I was afraid of when it came to upgrading to 5.x, the different SDK/runtime/MSBuild versions do not play nicely together 😢 The MSBuildLocator API was meant to handle correctly locating the version of MSBuild for the target SDK but if you’re seeing that message then it is returning unexpected results. I’ll take a look at this after work this evening (am in Australia so UTC+11 here) and see what I can do. I agree the error message could definitely be improved. I’ll have a think about how to do that (your suggestions are a great starting point!)... |
And: msbuild-project-tools-vscode/src/extension/extension.ts Lines 51 to 52 in 345579c
Perhaps we should only check the runtime version if the extension won’t load... |
What does |
I haven't used MSBuildLocator but it definitely seems more geared toward Visual Studio than .NET Core; I'm curious if they might have some insight on it. |
msbuild-project-tools-0.3.13.vsix.zip Can you try this package and see if it works for you? It now uses the host version, rather than the current runtime version (i.e. ignores |
I first uninstalled the one from the online gallery, then installed the VSIX. That went smoothly. I opened up the project and a notification "Initializing MSBuild project tools..." came up. I went to the Output window and noticed there were two output windows for "MSBuild Project Tools." In the first one, I saw the output:
In the second one I saw:
3.1.405 is the SDK version I'm targeting with the A full exit/restart/re-open project yielded the same error with the same two-output-window issue, so it doesn't appear to be tied to the uninstall/reinstall or anything. |
Hmmm. The two output window thing is still there after reinstalling the version from the marketplace. Perhaps it's always been like that? I also see the exact same error message, so... hmmm. |
Yeah I think maybe that second check is unnecessary. It’s just the runtime (host) version we care about. I’ll see if I can modify it this afternoon so it doesn’t care what SDK version it is using but logs the SDK version on startup. |
We do so by making a distinction between runtime (host) and SDK versions, using the runtime version as the target for the extension / language server itself, and using the SDK version to find an appropriate version of MSBuild. We will probably need to move the MSBuild stuff out to a separate process at some point in order to ensure that we can target multiple versions of MSBuild, etc. tintoy/msbuild-project-tools-vscode#73
We do so by making a distinction between runtime (host) and SDK versions, using the runtime version as the target for the extension / language server itself, and using the SDK version to find an appropriate version of MSBuild. We will probably need to move the MSBuild stuff out to a separate process at some point in order to ensure that we can target multiple versions of MSBuild, etc. #73
Ok, so I've improved the logic for this by making a distinction between runtime (host) and SDK versions, using the runtime version as the target for the extension / language server itself, and using the SDK version to find an appropriate version of MSBuild. We will probably need to move the MSBuild stuff out to a separate process at some point, though, in order to ensure that we can target multiple versions of the .NET SDK / MSBuild (otherwise we'll keep running into these cross-version problems). Will try to get you another package to try later today 🙂 |
msbuild-project-tools-0.3.13.vsix.zip Ok, can you give this one a try? You'll need to remove the old extension by hand before installing it (same version number). |
That version totally starts up and runs.
Verified I can hover over an |
Ok I’ll just add some logging for the MSBuild version and publish a new package :) |
Published v0.3.13 :) |
As of about 10 days ago the language server needs .NET SDK 5.0.102 installed in order to start, but you can target any SDK you want in your project. This took effect in release 0.3.12 of the VS Code plugin.
Unfortunately, from an end user perspective, the error message is slightly confusing. First VS Code pops up a note saying the language server couldn't start and you should check the logs. Then in the logs you get a message like this:
It was confusing to me both why it was trying to locate that version of .NET 5 (I have 5.0.100, it couldn't use that?) and also why it was looking for .NET 5 at all since the project where I discovered this was targeting .NET Core 3.1. After looking into how the project build tools work and seeing the changes, now I get it, but I'm curious if the error message could be improved with some sort of "call to action" explaining what's up.
Like, instead of just an exception and that's it, maybe a longer message saying what the readme says - you need to have .NET 5.0.102 (or compatible) installed, but you can target whatever you want... and here's a link to go download the latest SDK.
Or maybe the error message has a URL to an FAQ over here on GitHub that explains what it means and why.
Point being, it would be nice to have a slightly more helpful message that doesn't require research into how the language server works, if possible.
The text was updated successfully, but these errors were encountered: