Skip to content

Commit 10d533a

Browse files
PasswordHasher: retarget net10.0, fix the benchmark project's absolute HintPath (#2165)
- All three projects move from net8.0 to net10.0. - PasswordHasher.Benchmark.Tests referenced Microsoft.Extensions.Identity.Core through an absolute Windows HintPath pinned to SDK 8.0.4, so it built on one machine only. Replaced with <FrameworkReference Include="Microsoft.AspNetCore.App" />, which is how a non-web project reaches Identity.Core. - Package lifts, all read from NuGet on 2026-08-30: Microsoft.AspNetCore.OpenApi 8.0.4 -> 10.0.11, Swashbuckle.AspNetCore 6.4.0 -> 10.2.3, BenchmarkDotNet 0.13.12 -> 0.15.8, NUnit 3.14.0 -> 4.6.1, NUnit3TestAdapter 4.5.0 -> 6.3.0, NUnit.Analyzers 3.9.0 -> 4.14.0, Microsoft.NET.Test.Sdk 17.8.0 -> 18.9.0, coverlet.collector 6.0.0 -> 10.0.1. The tests already use the constraint model (Assert.That), so the NUnit 3 to 4 move needed no assertion rewrites. - One comment in CustomerService.Login() saying the sample ignores the SuccessRehashNeeded signal deliberately. Build 0 errors and 8/8 tests pass on SDK 10.0.302 / runtime 10.0.10.
1 parent 562261e commit 10d533a

4 files changed

Lines changed: 13 additions & 14 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.4"/>
11-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.11"/>
11+
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3"/>
1212
</ItemGroup>
1313

1414
</Project>

‎authorization-dotnet/PasswordHasher/PasswordHasher.Api/Services/CustomerService.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public LoginResult Login(LoginRequest request)
3636
switch (verificationResult)
3737
{
3838
case PasswordVerificationResult.Success:
39+
// This sample deliberately ignores the rehash signal: code calling IPasswordHasher<TUser> directly must rehash and save the password itself.
3940
case PasswordVerificationResult.SuccessRehashNeeded:
4041
return LoginResult.Success;
4142
default:

‎authorization-dotnet/PasswordHasher/PasswordHasher.Benchmark.Tests/PasswordHasher.Benchmark.Tests.csproj‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
11+
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<Reference Include="Microsoft.Extensions.Identity.Core">
16-
<HintPath>C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\8.0.4\Microsoft.Extensions.Identity.Core.dll</HintPath>
17-
</Reference>
15+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1816
</ItemGroup>
1917

2018
<ItemGroup>

‎authorization-dotnet/PasswordHasher/PasswordHasher.Tests/PasswordHasher.Tests.csproj‎

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

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

@@ -11,11 +11,11 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
16-
<PackageReference Include="NUnit" Version="3.14.0"/>
17-
<PackageReference Include="NUnit.Analyzers" Version="3.9.0"/>
18-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
14+
<PackageReference Include="coverlet.collector" Version="10.0.1"/>
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0"/>
16+
<PackageReference Include="NUnit" Version="4.6.1"/>
17+
<PackageReference Include="NUnit.Analyzers" Version="4.14.0"/>
18+
<PackageReference Include="NUnit3TestAdapter" Version="6.3.0"/>
1919
</ItemGroup>
2020

2121
<ItemGroup>

0 commit comments

Comments
 (0)