Fixes conflicting versions#2214
Conversation
…nd using 8.0 microsoft package versions and fix unnecessary package version repetition
There was a problem hiding this comment.
Pull request overview
This PR addresses version conflicts when upgrading FluentMigrator to 7.2.0 in applications targeting .NET 8.0 by introducing a flexible version range for Microsoft packages and removing redundant MSBuild configuration.
Key Changes:
- Introduces
$(MicrosoftPackageVersion)variable set to[8.0.0,)to allow flexible Microsoft package versions - Replaces hardcoded Microsoft package versions across all projects with the new variable
- Removes redundant
PackageReference Updateelements for JetBrains.Annotations from individual projects
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Global.props | Defines MicrosoftPackageVersion variable, updates JetBrains.Annotations to 2025.2.4, simplifies release notes |
| src/FluentMigrator/FluentMigrator.csproj | Uses variable for Microsoft.Extensions packages, removes redundant JetBrains reference |
| src/FluentMigrator.Runner/FluentMigrator.Runner.csproj | Uses variable for Configuration.Abstractions, removes redundant JetBrains reference |
| src/FluentMigrator.Runner.Core/FluentMigrator.Runner.Core.csproj | Uses variable for all Microsoft.Extensions packages, removes redundant JetBrains reference |
| src/FluentMigrator.Runner.Firebird/FluentMigrator.Runner.Firebird.csproj | Uses variable for Microsoft.Extensions.Options, removes redundant references |
| src/FluentMigrator.DotNet.Cli/FluentMigrator.DotNet.Cli.csproj | Uses variable for Microsoft packages, removes redundant JetBrains reference |
| src/FluentMigrator.Console/FluentMigrator.Console.csproj | Uses variable for Microsoft.Data.Sqlite, removes redundant JetBrains reference |
| src/FluentMigrator.Runner.SqlServer/FluentMigrator.Runner.SqlServer.csproj | Removes empty Folder ItemGroup and redundant JetBrains reference |
| src/FluentMigrator.Runner.{Db2,Hana,Jet,MySql,Oracle,Postgres,Redshift,Snowflake,SQLite}/FluentMigrator.Runner.*.csproj | Removes redundant JetBrains.Annotations references across all database runner projects |
| src/FluentMigrator.Extensions.{MySql,Oracle,Postgres,Snowflake,SqlServer}/FluentMigrator.Extensions.*.csproj | Removes redundant JetBrains.Annotations references across all extension projects |
| src/FluentMigrator.MSBuild/FluentMigrator.MSBuild.csproj | Removes redundant JetBrains.Annotations reference |
| src/FluentMigrator.Abstractions/FluentMigrator.Abstractions.csproj | Removes redundant JetBrains.Annotations reference |
| samples/FluentMigrator.Example.{Migrator,Migrations,MSBuild,TypeMapper}/FluentMigrator.Example.*.csproj | Uses variable for Microsoft packages and removes redundant references across sample projects |
| samples/FluentMigrator.Example.MSBuild/FluentMigrator.Example.MSBuild.csproj | Simplifies MigrationAssembly path logic to dynamically use $(TargetFramework) |
| test/FluentMigrator.Analyzers.Tests/FluentMigrator.Analyzers.Tests.csproj | Updates Microsoft.NET.Test.Sdk from 17.11.1 to 17.14.1 |
| test/FluentMigrator.Tests/FluentMigrator.Tests.csproj | Removes redundant JetBrains.Annotations reference |
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <MicrosoftPackageVersion>[8.0.0,)</MicrosoftPackageVersion> |
There was a problem hiding this comment.
The version range syntax "[8.0.0,)" means "8.0.0 or any higher version, including major versions like 9.0, 10.0, etc." While this achieves the goal of fixing version conflicts for consumers using .NET 8.0 packages, it could potentially introduce breaking changes when Microsoft releases future major versions. Consider using a more conservative range like "[8.0.0,10.0.0)" to avoid unexpected breaking changes while still providing flexibility for minor and patch version updates across .NET 8.0 and 9.0.
| <MicrosoftPackageVersion>[8.0.0,)</MicrosoftPackageVersion> | |
| <MicrosoftPackageVersion>[8.0.0,10.0.0)</MicrosoftPackageVersion> |
There was a problem hiding this comment.
@PhenX we can try this but I think the key approach is to build support for creating one's own in process runner.
There was a problem hiding this comment.
@PhenX we can try this but I think the key approach is to build support for creating one's own in process runner.
There was a problem hiding this comment.
@jzabroski I'm not sure it's needed to specify high limit, if I read this correctly : the lowest matching version will be used
There was a problem hiding this comment.
if you create an in-process runner rather than rely on FluentMigrator.Console or DotNet.Cli, yes, that's the point. Whatever version matches the overall constraint of the target will be used .
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
jzabroski
left a comment
There was a problem hiding this comment.
We can try this but:
- it may confuse dependabot.
- even Microsoft isn't always consistent with publishing package versions and some like Entity Framework authentication can be Framework version specific
When trying to update FM to 7.2.0 in an application targetting net8.0 and using 8.0 microsoft package versions, we got version conflicts.
This fixes it and also remove redundencies in msbuild files