Use dotnet.findpath to resolve the existing global installed version #135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue where on linux (maybe elsewhere also) autocompletion/preview asks you to build the project, but clicking build the project, or building the project doesn't help.
This code was using
dotnet.acquire
to get the runtime version of dotnet to use. This is resolving an old version of dotnet runtime (8.0.10).I suspect this wasn't working because it needs the sdk to do the build not just the runtime. However using the alternative
dotnet.acquireGlobalSDK
would fail on Ubuntu 22.04 with a message that said dotnet sdk 8.0.403 isn't officially supported on ubuntu 22.04 (this is despite this being the exact version I already have installed)People have pointed out that you can work around this by specifying the global dotnet to use in your vscode settings.json as follows:
This merge request formalises this by making the extension find and use the global installed dotnet using the new
dotnet.findpath
the details of which you can find here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/commands.mdIt does mean that people need to install dotnet themselves, as the extension will no longer install one for itself to use. However if you developing an avalonia app you have to already have dotnet installed so I think this is OK.
This may resolve #123, #117, #88
To get things fully working again I also had to update the versions of Microsoft.Build and Microsoft.Build.Utilities.Core in the upstream SolutionParser, I've also raised a pull request against it to fix that here: AvaloniaUI/SolutionParser#4