Skip to content

Commit 322dfc2

Browse files
authored
Upgrade to net10.0 (#1083)
* Initial upgrade to dotnet 10 * Update test to react to behaviour change in net10
1 parent ac3f43c commit 322dfc2

File tree

10 files changed

+14
-21
lines changed

10 files changed

+14
-21
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "coreclr",
77
"request": "launch",
88
"preLaunchTask": "build",
9-
"program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net9.0/SampleApp.dll",
9+
"program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net10.0/SampleApp.dll",
1010
"args": [],
1111
"cwd": "${workspaceFolder}/samples/SampleApp",
1212
"stopAtEntry": false,

.vsconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"components": [
44
"Microsoft.VisualStudio.Component.CoreEditor",
55
"Microsoft.VisualStudio.Workload.CoreEditor",
6-
"Microsoft.NetCore.Component.Runtime.9.0",
6+
"Microsoft.NetCore.Component.Runtime.10.0",
77
"Microsoft.NetCore.Component.SDK",
88
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
99
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices"

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageVersion Include="Shouldly" Version="4.3.0" />
1919
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
2020
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
21-
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
21+
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
2222
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
2323
<PackageVersion Include="xunit.v3" Version="3.1.0" />
2424
</ItemGroup>

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": "9.0.307",
3+
"version": "10.0.100",
44
"allowPrerelease": false,
55
"rollForward": "latestMajor"
66
}

samples/SampleApp.Tests/SampleApp.Tests.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
<IsTestProject>true</IsTestProject>
44
<NoWarn>$(NoWarn);CA1056;CA1062;CA1707;CA1711;CA1861;CA2007;SA1600</NoWarn>
55
<OutputType>Exe</OutputType>
6-
<TargetFrameworks>net9.0</TargetFrameworks>
6+
<TargetFrameworks>net10.0</TargetFrameworks>
77
</PropertyGroup>
88
<ItemGroup>
99
<Content Include="testsettings.json;xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
1010
</ItemGroup>
1111
<ItemGroup>
12-
<WebApplicationFactoryContentRootAttribute
13-
Include="SampleApp"
14-
AssemblyName="SampleApp"
15-
ContentRootPath="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../SampleApp'))"
16-
ContentRootTest="SampleApp.csproj"
17-
Priority="-1" />
12+
<WebApplicationFactoryContentRootAttribute Include="SampleApp" AssemblyName="SampleApp" ContentRootPath="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../SampleApp'))" ContentRootTest="SampleApp.csproj" Priority="-1" />
1813
</ItemGroup>
1914
<ItemGroup>
2015
<FrameworkReference Include="Microsoft.AspNetCore.App" />

samples/SampleApp/SampleApp.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
<PropertyGroup>
33
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
44
<NoWarn>$(NoWarn);CA1062;CA2007;SA1600</NoWarn>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="Refit" />
9-
<PackageReference Include="System.Text.Json" OverrideVersion="9.0.0" />
109
</ItemGroup>
1110
</Project>

tests/HttpClientInterception.Benchmarks/JustEat.HttpClientInterception.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<OutputType>Exe</OutputType>
66
<RootNamespace>JustEat.HttpClientInterception</RootNamespace>
77
<Summary>Benchmarks for JustEat.HttpClientInterception</Summary>
8-
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
8+
<TargetFrameworks>net472;net10.0</TargetFrameworks>
99
</PropertyGroup>
1010
<ItemGroup>
1111
<Content Include="organization.json" CopyToOutputDirectory="PreserveNewest" />

tests/HttpClientInterception.Tests/Examples.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,7 @@ public static async Task Inject_Latency_For_Http_Get_With_Cancellation()
718718
using var client = options.CreateHttpClient();
719719

720720
// Act
721-
await Should.ThrowAsync<TaskCanceledException>(
722-
() => client.GetAsync("http://www.google.co.uk", cts.Token));
721+
await client.GetAsync("http://www.google.co.uk", cts.Token);
723722

724723
// Assert
725724
cts.IsCancellationRequested.ShouldBeTrue();

tests/HttpClientInterception.Tests/InterceptingHttpMessageHandlerTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ public static async Task SendAsync_Calls_Inner_Handler_If_Registration_Missing()
6767

6868
options.OnMissingRegistration = (request) => Task.FromResult<HttpResponseMessage>(null);
6969

70-
using var handler = Substitute.For<HttpMessageHandler>();
71-
using var expected = new HttpResponseMessage(HttpStatusCode.OK);
72-
using var request = new HttpRequestMessage(HttpMethod.Options, "https://google.com/foo");
70+
var handler = Substitute.For<HttpMessageHandler>();
71+
var expected = new HttpResponseMessage(HttpStatusCode.OK);
72+
var request = new HttpRequestMessage(HttpMethod.Options, "https://google.com/foo");
7373

7474
handler.GetType()
7575
.GetMethod("SendAsync", BindingFlags.NonPublic | BindingFlags.Instance)
7676
.Invoke(handler, [request, Arg.Any<CancellationToken>()])
7777
.Returns(Task.FromResult(expected));
7878

79-
using var httpClient = options.CreateHttpClient(handler);
79+
var httpClient = options.CreateHttpClient(handler);
8080

8181
// Act
8282
var actual = await httpClient.SendAsync(request, CancellationToken.None);

tests/HttpClientInterception.Tests/JustEat.HttpClientInterception.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<OutputType>Exe</OutputType>
77
<RootNamespace>JustEat.HttpClientInterception</RootNamespace>
88
<Summary>Tests for JustEat.HttpClientInterception</Summary>
9-
<TargetFramework>net9.0</TargetFramework>
9+
<TargetFramework>net10.0</TargetFramework>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Content Include="example-bundle.json;xunit.runner.json;Bundles\*.json" CopyToOutputDirectory="PreserveNewest" />

0 commit comments

Comments
 (0)