Skip to content

Commit 9bbfbaf

Browse files
committed
Upgrade Roslyn to .NET8
1 parent e9f0a13 commit 9bbfbaf

File tree

8 files changed

+19
-13
lines changed

8 files changed

+19
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
55

66
## Latest
7+
* Update Roslyn to run on .NET 8 (PR: [#6840](https://github.com/dotnet/vscode-csharp/pull/6840))
8+
9+
## 2.17.7
710
* Update Roslyn to 4.10.0-2.24102.11 (PR: [#6847](https://github.com/dotnet/vscode-csharp/pull/6847))
811
* Fix another issue loading .NET projects when only the 6.0 SDK is installed (PR: [#71881](https://github.com/dotnet/roslyn/pull/71881))
912
* Fix request info leak when project loading is cancelled (PR: [#71737](https://github.com/dotnet/roslyn/pull/71737))

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ This section shows how to set up local Razor or Roslyn language servers for debu
6767
1. Clone the [Roslyn repository](https://github.com/dotnet/roslyn). This repository contains the Roslyn server implementation.
6868
2. Follow the build instructions provided in the repository.
6969

70-
The server DLL is typically at `$roslynRepoRoot/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net7.0/Microsoft.CodeAnalysis.LanguageServer.dll`, but this may vary based on the built configuration.
70+
The server DLL is typically at `$roslynRepoRoot/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll`, but this may vary based on the built configuration.
7171

7272
#### Razor
7373

@@ -110,7 +110,7 @@ In your workspace `settings.json` file, add the following lines:
110110

111111
```json
112112
"dotnet.server.waitForDebugger": true,
113-
"dotnet.server.path": "<roslynRepoRoot>/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net7.0/Microsoft.CodeAnalysis.LanguageServer.dll"
113+
"dotnet.server.path": "<roslynRepoRoot>/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll"
114114
```
115115

116116
Replace <roslynRepoRoot> with the actual path to your Roslyn repository.

azure-pipelines/prereqs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ steps:
1616
- task: UseDotNet@2
1717
displayName: 'Install .NET Core SDKs'
1818
inputs:
19-
version: '7.x'
19+
version: '8.x'
2020

2121
- script: |
2222
dotnet tool install --tool-path $(Agent.BuildDirectory) nbgv

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
},
3939
"defaults": {
40-
"roslyn": "4.10.0-2.24102.11",
40+
"roslyn": "4.10.0-2.24105.1",
4141
"omniSharp": "1.39.11",
4242
"razor": "7.0.0-preview.23627.2",
4343
"razorOmnisharp": "7.0.0-preview.23363.1",

server/ServerDownload.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!-- It's still PackageReference, so project intermediates are still created. -->
1313
<MSBuildProjectExtensionsPath>$(RestorePackagesPath)obj/</MSBuildProjectExtensionsPath>
1414
<!-- This is not super relevant, as long as your SDK version supports it. -->
15-
<TargetFramework>net7.0</TargetFramework>
15+
<TargetFramework>net8.0</TargetFramework>
1616
<!-- If a package is resolved to a fallback folder, it may not be downloaded.-->
1717
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
1818
<!-- We don't want to build this project, so we do not need the reference assemblies for the framework we chose.-->

src/lsptoolshost/dotnetRuntimeExtensionResolver.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { getDotnetInfo } from '../shared/utils/getDotnetInfo';
1616
import { readFile } from 'fs/promises';
1717
import { RuntimeInfo } from '../shared/utils/dotnetInfo';
1818

19-
export const DotNetRuntimeVersion = '7.0';
19+
export const DotNetRuntimeVersion = '8.0';
2020

2121
interface IDotnetAcquireResult {
2222
dotnetPath: string;
@@ -26,7 +26,6 @@ interface IDotnetAcquireResult {
2626
* Resolves the dotnet runtime for a server executable from given options and the dotnet runtime VSCode extension.
2727
*/
2828
export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
29-
private readonly minimumDotnetRuntimeVersion = '7.0';
3029
constructor(
3130
private platformInfo: PlatformInformation,
3231
/**
@@ -163,9 +162,9 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
163162
}
164163

165164
// Verify that the dotnet we found includes a runtime version that is compatible with our requirement.
166-
const requiredRuntimeVersion = semver.parse(`${this.minimumDotnetRuntimeVersion}.0`);
165+
const requiredRuntimeVersion = semver.parse(`${DotNetRuntimeVersion}.0`);
167166
if (!requiredRuntimeVersion) {
168-
throw new Error(`Unable to parse minimum required version ${this.minimumDotnetRuntimeVersion}`);
167+
throw new Error(`Unable to parse minimum required version ${DotNetRuntimeVersion}`);
169168
}
170169

171170
const coreRuntimeVersions = dotnetInfo.Runtimes['Microsoft.NETCore.App'];
@@ -180,7 +179,7 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
180179

181180
if (!matchingRuntime) {
182181
throw new Error(
183-
`No compatible .NET runtime found. Minimum required version is ${this.minimumDotnetRuntimeVersion}.`
182+
`No compatible .NET runtime found. Minimum required version is ${DotNetRuntimeVersion}.`
184183
);
185184
}
186185

tasks/offlinePackagingTasks.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ export const platformSpecificPackages: VSIXPlatformInfo[] = [
4747
{ vsceTarget: 'win32-arm64', rid: 'win-arm64', platformInfo: new PlatformInformation('win32', 'arm64') },
4848
{ vsceTarget: 'linux-x64', rid: 'linux-x64', platformInfo: new PlatformInformation('linux', 'x86_64') },
4949
{ vsceTarget: 'linux-arm64', rid: 'linux-arm64', platformInfo: new PlatformInformation('linux', 'arm64') },
50-
{ vsceTarget: 'alpine-x64', rid: 'alpine-x64', platformInfo: new PlatformInformation('linux-musl', 'x86_64') },
51-
{ vsceTarget: 'alpine-arm64', rid: 'alpine-arm64', platformInfo: new PlatformInformation('linux-musl', 'arm64') },
50+
{ vsceTarget: 'alpine-x64', rid: 'linux-musl-x64', platformInfo: new PlatformInformation('linux-musl', 'x86_64') },
51+
{
52+
vsceTarget: 'alpine-arm64',
53+
rid: 'linux-musl-arm64',
54+
platformInfo: new PlatformInformation('linux-musl', 'arm64'),
55+
},
5256
{ vsceTarget: 'darwin-x64', rid: 'osx-x64', platformInfo: new PlatformInformation('darwin', 'x86_64') },
5357
{ vsceTarget: 'darwin-arm64', rid: 'osx-arm64', platformInfo: new PlatformInformation('darwin', 'arm64') },
5458
];

test/integrationTests/testAssets/slnWithCsproj/test/test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66

77
<IsPackable>false</IsPackable>

0 commit comments

Comments
 (0)