Skip to content

Commit 1d0ecd5

Browse files
[Infra] Update to .NET 10 RC1
- Update to release candidate 1 of .NET 10. - Remove obsolete `IWebHost` usage.
1 parent 5c1154f commit 1d0ecd5

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
33
"rollForward": "latestFeature",
4-
"version": "10.0.100-preview.7.25380.108"
4+
"version": "10.0.100-rc.1.25451.107"
55
}
66
}

test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
</ItemGroup>
1717

1818
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'" >
19-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.0-preview.7.25380.108" />
20-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.7.25380.108"/>
19+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.0-rc.1.25451.107" />
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-rc.1.25451.107"/>
2121
</ItemGroup>
2222

2323
<ItemGroup>

test/OpenTelemetry.Instrumentation.Cassandra.Tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG TEST_SDK_VERSION=10.0
77

88
FROM mcr.microsoft.com/dotnet/sdk:8.0.413@sha256:7fd287cec03e027e39be13fb06ca1347f1338c7a6ab4ad305d94d91852693f70 AS dotnet-sdk-8.0
99
FROM mcr.microsoft.com/dotnet/sdk:9.0.304@sha256:ae000be75dac94fc40e00f0eee903289e985995cc06dac3937469254ce5b60b6 AS dotnet-sdk-9.0
10-
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-preview.7@sha256:1d5e6f2c1ece7d5826bafc8a7f2d54db2c6478a0f2bd1c995d05a37c0be4783e AS dotnet-sdk-10.0
10+
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-rc.1@sha256:32cd7d97e0814307e594f9f3e33aa039ddcf125191fd7add32c7370d2a6118b9 AS dotnet-sdk-10.0
1111

1212
FROM dotnet-sdk-${BUILD_SDK_VERSION} AS build
1313
ARG PUBLISH_CONFIGURATION=Release

test/OpenTelemetry.Instrumentation.ConfluentKafka.Tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG TEST_SDK_VERSION=10.0
77

88
FROM mcr.microsoft.com/dotnet/sdk:8.0.413@sha256:7fd287cec03e027e39be13fb06ca1347f1338c7a6ab4ad305d94d91852693f70 AS dotnet-sdk-8.0
99
FROM mcr.microsoft.com/dotnet/sdk:9.0.304@sha256:ae000be75dac94fc40e00f0eee903289e985995cc06dac3937469254ce5b60b6 AS dotnet-sdk-9.0
10-
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-preview.7@sha256:1d5e6f2c1ece7d5826bafc8a7f2d54db2c6478a0f2bd1c995d05a37c0be4783e AS dotnet-sdk-10.0
10+
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-rc.1@sha256:32cd7d97e0814307e594f9f3e33aa039ddcf125191fd7add32c7370d2a6118b9 AS dotnet-sdk-10.0
1111

1212
FROM dotnet-sdk-${BUILD_SDK_VERSION} AS build
1313
ARG PUBLISH_CONFIGURATION=Release

test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG TEST_SDK_VERSION=10.0
77

88
FROM mcr.microsoft.com/dotnet/sdk:8.0.413@sha256:7fd287cec03e027e39be13fb06ca1347f1338c7a6ab4ad305d94d91852693f70 AS dotnet-sdk-8.0
99
FROM mcr.microsoft.com/dotnet/sdk:9.0.304@sha256:ae000be75dac94fc40e00f0eee903289e985995cc06dac3937469254ce5b60b6 AS dotnet-sdk-9.0
10-
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-preview.7@sha256:1d5e6f2c1ece7d5826bafc8a7f2d54db2c6478a0f2bd1c995d05a37c0be4783e AS dotnet-sdk-10.0
10+
FROM mcr.microsoft.com/dotnet/sdk:10.0.100-rc.1@sha256:32cd7d97e0814307e594f9f3e33aa039ddcf125191fd7add32c7370d2a6118b9 AS dotnet-sdk-10.0
1111

1212
FROM dotnet-sdk-${BUILD_SDK_VERSION} AS build
1313
ARG PUBLISH_CONFIGURATION=Release

test/OpenTelemetry.Resources.AWS.Tests/AWSECSDetectorTests.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
using System.Text;
77
using Microsoft.AspNetCore.Builder;
88
using Microsoft.AspNetCore.Hosting;
9+
using Microsoft.AspNetCore.Hosting.Server;
910
using Microsoft.AspNetCore.Hosting.Server.Features;
1011
using Microsoft.AspNetCore.Http;
12+
using Microsoft.Extensions.DependencyInjection;
13+
using Microsoft.Extensions.Hosting;
1114
using Xunit;
1215

1316
namespace OpenTelemetry.Resources.AWS.Tests;
@@ -143,11 +146,12 @@ internal void ResetEnvironment()
143146
internal class MockEcsMetadataEndpoint : IAsyncDisposable
144147
{
145148
public readonly Uri Address;
146-
private readonly IWebHost server;
149+
private readonly IHost host;
147150

148151
public MockEcsMetadataEndpoint(string containerJsonPath, string taskJsonPath)
149152
{
150-
this.server = new WebHostBuilder()
153+
this.host = new HostBuilder()
154+
.ConfigureWebHost(builder => builder
151155
.UseKestrel()
152156
.UseUrls("http://127.0.0.1:0") // Use random localhost port
153157
.Configure(app =>
@@ -174,21 +178,18 @@ public MockEcsMetadataEndpoint(string containerJsonPath, string taskJsonPath)
174178
await context.Response.WriteAsync("Not found");
175179
}
176180
});
177-
}).Build();
178-
this.server.Start();
181+
})).Build();
182+
this.host.Start();
179183

180-
this.Address = new Uri(this.server.ServerFeatures.Get<IServerAddressesFeature>()!.Addresses.First());
184+
var server = this.host.Services.GetRequiredService<IServer>();
185+
this.Address = new Uri(server.Features.Get<IServerAddressesFeature>()!.Addresses.First());
181186
}
182187

183-
public async ValueTask DisposeAsync()
184-
{
188+
public async ValueTask DisposeAsync() =>
185189
await this.DisposeAsyncCore();
186-
}
187190

188-
protected virtual async ValueTask DisposeAsyncCore()
189-
{
190-
await this.server.StopAsync();
191-
}
191+
protected virtual async ValueTask DisposeAsyncCore() =>
192+
await this.host.StopAsync();
192193
}
193194

194195
private static class ExpectedSemanticConventions

0 commit comments

Comments
 (0)