Conversation
Make the default MicroBenchmarks target list SDK-compatible and remove EOL net6.0/net7.0 defaults so dotnet run -f <tfm> works without PERFLAB_TARGET_FRAMEWORKS. Keep explicit overrides working for specific TFMs like net472. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Inline the NETCoreAppMaximumVersion compatibility checks instead of introducing a temporary helper property, while keeping the default framework list SDK-compatible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the microbenchmarks project’s default target framework selection to be SDK-aware so local dotnet run -f <tfm> works without requiring PERFLAB_TARGET_FRAMEWORKS, and refreshes related documentation.
Changes:
- Compute default
SupportedTargetFrameworksfromNETCoreAppMaximumVersionso the project targets only TFMs supported by the installed SDK. - Make
TargetFrameworksautomatically pick upTargetFrameworkwhen usingdotnet run -f <tfm>. - Update BenchmarkDotNet docs to describe the new default TFM behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/benchmarks/micro/MicroBenchmarks.csproj | Makes default TFM list SDK-compatible; adjusts package references for framework-specific builds. |
| docs/benchmarkdotnet.md | Updates build/run guidance to reflect new default targeting behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Drop the explicit System.Collections.Immutable PackageReference from MicroBenchmarks since the project still restores and builds for the supported modern TFMs without it, and the remaining net472 issue is unrelated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a non-empty TargetFrameworks fallback for unsupported older SDKs and update the BenchmarkDotNet docs to recommend PERFLAB_TARGET_FRAMEWORKS instead of manually editing the conditional SupportedTargetFrameworks blocks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a brief project-file comment clarifying that the extra .NETFramework package references are only for the opt-in net472 path, such as PERFLAB_TARGET_FRAMEWORKS=net472. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The extra package references in the .NETFramework item group are only there for the explicit net472 path. That path isn’t part of the default local-run flow this PR is fixing; if someone wants to exercise it, the intended mechanism is still to narrow the project via PERFLAB_TARGET_FRAMEWORKS=net472 (or an equivalent TargetFrameworks override). I also verified that net472 is currently broken for separate compile reasons (MemoryStreamChunkedTests, DictionaryTryRemove, etc.), so fixing that is outside the scope of this change. That’s why I’m keeping net472 out of the default target list here. |
Document that local benchmark runs need the SDK for the target runtime plus the SDK required by global.json (or newer), and note that global.json can be updated locally to the SDK version being tested. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the default MicroBenchmarks target list SDK-compatible and remove EOL net6.0/net7.0 defaults so dotnet run -f works without PERFLAB_TARGET_FRAMEWORKS. Keep explicit overrides working for specific TFMs like net472.