Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use MSBuild version comparison functions instead of numerical compari…
…sons

Replace direct numerical comparisons with MSBuild's built-in version comparison functions for better reliability and correctness.

Changes:
- Updated Directory.Build.targets to use MSBuild::VersionGreaterThanOrEquals for RoslynVersion comparisons
- Changed $(RoslynVersion) >= 4.7 to $([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.7'))
- Changed $(RoslynVersion) >= 4.14 to $([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.14'))

Benefits:
- Correct semantic version comparison (handles "4.10" > "4.9" properly)
- Better compatibility across different MSBuild versions
- Type-safe version comparisons

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
thomhurst and claude committed Aug 8, 2025
commit ea57649eb75e57d4014278467983115df2acdf34
4 changes: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<DefineConstants Condition="$(RoslynVersion) >= 4.7">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<DefineConstants Condition="$(RoslynVersion) >= 4.14">$(DefineConstants);ROSLYN4_14_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.7'))">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(RoslynVersion)', '4.14'))">$(DefineConstants);ROSLYN4_14_OR_GREATER</DefineConstants>
</PropertyGroup>
</Project>
Loading