Ensure the VSCode server process runs on non-preview runtime #70446
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.
The change
Removes the
RuntimeFrameworkVersion
specified in the VSCode language server process (and adds logging as to which dotnet runtime the server and build host process are running on)Why we specified
RuntimeFrameworkVersion
in the pastSpecifying the
RuntimeFrameworkVersion
was an old hack that allowed the main server process to roll forward to run on preview runtimes. This was required to be able to load some projects using preview SDKs.Why we don't need
RuntimeFrameworkVersion
nowWe now launch a separate build host process with roll forward
LatestMajor
andDOTNET_ROLL_FORWARD_TO_PRERELEASE
to1
. This will allow the build host to run and load the project on preview runtimes. It is not necessary for our main server process to run on preview runtimes.Why this is changing now
Setting
RuntimeFrameworkVersion
to a preview version causes the language server to prefer to run on a preview version of .NET 7, even when a non-preview version of .NET 7 is installed.This causes the exceptions noted in dotnet/vscode-csharp#6479 because the version of
System.Text.Json
in the .NET 7 Preview 7 SDK is missing theJsonRequiredAttribute
. But the copy ofNewtonsoft.Json
in the server is expecting it to be present (and it is available in non-preview versions of .NET 7).Note: if only a preview version of .NET 7 is installed it won't match our runtime version requirement and we will download a non-preview .NET 7 runtime (via the runtime installer extension).
Resolves dotnet/vscode-csharp#6479