Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

The warning in Blazor.Directory.Build.targets was triggering incorrectly for net10.0 and net11.0 builds despite both having proper package version definitions in Blazor.PackageVersions.props.

Changes

Updated the warning condition in src/scenarios/build-common/Blazor.Directory.Build.targets (line 8):

  • net10.0net12.0
  • VersionGreaterThan('9.0')VersionGreaterThan('11.0')

The warning now only triggers for net12.0+ TFMs that lack package version configurations, aligning with the existing definitions in Blazor.PackageVersions.props which include net10.0 and net11.0.

<!-- Before -->
<Warning Condition="$(TargetFrameworks.Contains('net10.0')) or ($(TargetFrameworkVersion) != '' and $([MSBuild]::VersionGreaterThan('$(TargetFrameworkVersion)', '9.0')))" ... />

<!-- After -->
<Warning Condition="$(TargetFrameworks.Contains('net12.0')) or ($(TargetFrameworkVersion) != '' and $([MSBuild]::VersionGreaterThan('$(TargetFrameworkVersion)', '11.0')))" ... />
Original prompt

Summary

The package versions for Blazor have been properly updated for net11.0 in Blazor.PackageVersions.props, but the warning in Blazor.Directory.Build.targets still triggers for net10.0 and net11.0 builds even though they are now properly configured.

Current Behavior

The warning condition in src/scenarios/build-common/Blazor.Directory.Build.targets currently checks:

Condition="$(TargetFrameworks.Contains('net10.0')) or ($(TargetFrameworkVersion) != '' and $([MSBuild]::VersionGreaterThan('$(TargetFrameworkVersion)', '9.0')))"

This causes warnings to appear for net10.0 and net11.0 runs, even though both frameworks now have proper package version definitions in Blazor.PackageVersions.props.

Expected Behavior

The warning should only trigger for TFMs that don't yet have package versions configured (i.e., net12.0 and higher).

Required Change

Update line 8 in src/scenarios/build-common/Blazor.Directory.Build.targets to change the warning condition from:

Condition="$(TargetFrameworks.Contains('net10.0')) or ($(TargetFrameworkVersion) != '' and $([MSBuild]::VersionGreaterThan('$(TargetFrameworkVersion)', '9.0')))"

To:

Condition="$(TargetFrameworks.Contains('net12.0')) or ($(TargetFrameworkVersion) != '' and $([MSBuild]::VersionGreaterThan('$(TargetFrameworkVersion)', '11.0')))"

This ensures:

  • net10.0 → Changed to net12.0
  • VersionGreaterThan('$(TargetFrameworkVersion)', '9.0') → Changed to VersionGreaterThan('$(TargetFrameworkVersion)', '11.0')

Context

The Blazor.PackageVersions.props file already has the net11.0 configuration at the top:

<PropertyGroup Condition="$(TargetFrameworks.Contains('net11.0')) or ($(TargetFrameworkVersion) != '' and $([MSBuild]::VersionEquals('$(TargetFrameworkVersion)', '11.0')))">
    <AspNetCoreVersion>11.0.0-*</AspNetCoreVersion>
    <BlazorVersion>11.0.0-*</BlazorVersion>
    <SystemNetHttpJsonVersion>11.0.0-*</SystemNetHttpJsonVersion>
</PropertyGroup>

So the warning is no longer needed for net11.0 (or net10.0) runs.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update warning condition for package version checks Update Blazor warning condition to net12.0 threshold Jan 15, 2026
Copilot AI requested a review from LoopedBard3 January 15, 2026 23:30
@LoopedBard3 LoopedBard3 marked this pull request as ready for review January 15, 2026 23:43
Copy link
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

This PR updates the warning condition in the Blazor build targets to prevent false warnings for .NET 10.0 and 11.0, which already have proper package version configurations defined.

Changes:

  • Updated warning threshold from net10.0/9.0 to net12.0/11.0 in Blazor.Directory.Build.targets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

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