Skip to content

Commit 63cf922

Browse files
authored
Use .NET 9 SDK (#4942)
* Update workflows * Update global.json * Fix new SDK warnings * Use 9.0 SDK in Dockerfiles
1 parent 8788261 commit 63cf922

File tree

17 files changed

+29
-24
lines changed

17 files changed

+29
-24
lines changed

.github/workflows/build-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- name: Setup .NET SDK
2020
uses: actions/[email protected]
2121
with:
22+
global-json-file: global.json
2223
dotnet-version: 8.0.x
2324
- name: Download RavenDB Server
2425
run: ./tools/download-ravendb-server.ps1

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- name: Setup .NET SDK
4141
uses: actions/[email protected]
4242
with:
43+
global-json-file: global.json
4344
dotnet-version: 8.0.x
4445
- name: Download RavenDB Server
4546
run: ./tools/download-ravendb-server.ps1

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.400",
3+
"version": "9.0.100",
44
"rollForward": "latestFeature"
55
},
66
"msbuild-sdks": {

src/ServiceControl.Api/IAuditCountApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
public interface IAuditCountApi
99
{
10-
public Task<IList<AuditCount>> GetEndpointAuditCounts(string endpoint, CancellationToken token);
10+
Task<IList<AuditCount>> GetEndpointAuditCounts(string endpoint, CancellationToken token);
1111
}
1212
}

src/ServiceControl.Api/IConfigurationApi.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66

77
public interface IConfigurationApi
88
{
9-
public Task<RootUrls> GetUrls(string baseUrl, CancellationToken cancellationToken);
10-
public Task<object> GetConfig(CancellationToken cancellationToken);
11-
public Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellationToken);
9+
Task<RootUrls> GetUrls(string baseUrl, CancellationToken cancellationToken);
10+
11+
Task<object> GetConfig(CancellationToken cancellationToken);
12+
13+
Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellationToken);
1214
}
1315
}

src/ServiceControl.Api/IEndpointsApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
public interface IEndpointsApi
99
{
10-
public Task<List<Endpoint>> GetEndpoints(CancellationToken cancellationToken);
10+
Task<List<Endpoint>> GetEndpoints(CancellationToken cancellationToken);
1111
}
1212
}

src/ServiceControl.Audit.UnitTests/Infrastructure/When_instance_is_setup.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ public void CustomizeMonitoringEndpoint(EndpointConfiguration endpointConfigurat
7575

7676
public Task ProvisionQueues(TransportSettings transportSettings, IEnumerable<string> additionalQueues)
7777
{
78-
QueuesCreated = new List<string>(additionalQueues)
79-
{
78+
QueuesCreated =
79+
[
80+
.. additionalQueues,
8081
transportSettings.EndpointName,
8182
transportSettings.ErrorQueue
82-
};
83+
];
8384
return Task.CompletedTask;
8485
}
8586

src/ServiceControl.Audit/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build image
2-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
33
ARG TARGETARCH
44
WORKDIR /
55
ENV CI=true

src/ServiceControl.Audit/Infrastructure/Hosting/Options.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public IEnumerator<string> GetEnumerator()
167167

168168
public List<string> ToList()
169169
{
170-
return new List<string>(values);
170+
return [.. values];
171171
}
172172

173173
public string[] ToArray()

src/ServiceControl.Audit/Infrastructure/Settings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public Settings(string transportType = null, string persisterType = null, Loggin
4343
{
4444
Hostname = SettingsReader.Read(SettingsRootNamespace, "Hostname", "localhost");
4545
Port = SettingsReader.Read(SettingsRootNamespace, "Port", 44444);
46-
};
46+
}
4747

4848
MaximumConcurrencyLevel = SettingsReader.Read<int?>(SettingsRootNamespace, "MaximumConcurrencyLevel");
4949
ServiceControlQueueAddress = SettingsReader.Read<string>(SettingsRootNamespace, "ServiceControlQueueAddress");

0 commit comments

Comments
 (0)