Skip to content

Fix local run default#5197

Merged
LoopedBard3 merged 6 commits intodotnet:mainfrom
LoopedBard3:FixLocalRunDefault
Apr 14, 2026
Merged

Fix local run default#5197
LoopedBard3 merged 6 commits intodotnet:mainfrom
LoopedBard3:FixLocalRunDefault

Conversation

@LoopedBard3
Copy link
Copy Markdown
Member

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.

LoopedBard3 and others added 2 commits April 9, 2026 13:05
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SupportedTargetFrameworks from NETCoreAppMaximumVersion so the project targets only TFMs supported by the installed SDK.
  • Make TargetFrameworks automatically pick up TargetFramework when using dotnet 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.

Comment thread src/benchmarks/micro/MicroBenchmarks.csproj
Comment thread src/benchmarks/micro/MicroBenchmarks.csproj Outdated
Comment thread docs/benchmarkdotnet.md Outdated
LoopedBard3 and others added 3 commits April 9, 2026 13:26
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>
@LoopedBard3
Copy link
Copy Markdown
Member Author

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.

@LoopedBard3 LoopedBard3 requested a review from DrewScoggins April 9, 2026 21:15
@LoopedBard3 LoopedBard3 marked this pull request as ready for review April 9, 2026 21:15
@LoopedBard3 LoopedBard3 marked this pull request as draft April 9, 2026 21:41
@LoopedBard3 LoopedBard3 marked this pull request as ready for review April 10, 2026 17:37
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>
Copy link
Copy Markdown
Member

@DrewScoggins DrewScoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LoopedBard3 LoopedBard3 merged commit dffd087 into dotnet:main Apr 14, 2026
75 checks passed
@LoopedBard3 LoopedBard3 deleted the FixLocalRunDefault branch April 14, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants