PasswordHasher: retarget net10.0 and fix the benchmark project's absolute HintPath - #2165
Open
vladimir-pecanac-main wants to merge 1 commit into
Open
Conversation
…e HintPath - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retargets
authorization-dotnet/PasswordHasherto .NET 10 and fixes the one defect that made the benchmark project unbuildable on any machine but its author's.The real defect
PasswordHasher.Benchmark.Tests.csprojreachedMicrosoft.Extensions.Identity.Corethrough an absolute WindowsHintPathpinned to SDK patch8.0.4, so it failed on Linux, on macOS, on CI, and on any Windows box with a different patch installed. Replaced with:which is how a non-web
Microsoft.NET.Sdkproject reaches Identity.Core. Verified by building, not assumed.Retarget and package lifts
All three projects move
net8.0->net10.0. Versions read from NuGet on 2026-08-30, not from memory:Microsoft.AspNetCore.OpenApiSwashbuckle.AspNetCoreBenchmarkDotNetNUnitNUnit3TestAdapterNUnit.AnalyzersMicrosoft.NET.Test.Sdkcoverlet.collectorThe eight test cases already use the constraint model (
Assert.That), so the NUnit 3 to 4 move needed no assertion rewrites.One comment
CustomerService.Login()foldsSuccessRehashNeededinto the success case. That is a correct login decision but an incomplete example, so one comment line now says the omission is deliberate. No behaviour change: a real rehash needs a repository write the in-memory store would make meaningless.Build and tests
SDK 10.0.302, runtime 10.0.10.
Benchmark re-run on net10.0, output verbatim
The published article's benchmark table was measured on the
net8.0build, so it was re-run here.dotnet run -c Release -- --filter '*', pasted exactly as BenchmarkDotNet printed it:Both qualitative claims the article draws from this table still hold on .NET 10: V2 is faster than V3 at the same 1,000 iterations (517.6 us against 610.4 us), and V3's time scales proportionally with the iteration count (roughly 10x per 10x, across four orders of magnitude).