diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f91c35e4..78bedcf34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,13 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x - name: Install SQL Local DB run: ./Setup.ps1 shell: pwsh @@ -35,7 +39,7 @@ jobs: run: ./Push.ps1 shell: pwsh - name: Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: artifacts path: artifacts/**/* \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2d6157b3..217e7177d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,13 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x - name: Install SQL Local DB run: ./Setup.ps1 shell: pwsh @@ -36,7 +40,7 @@ jobs: run: ./Push.ps1 shell: pwsh - name: Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: artifacts path: artifacts/**/* \ No newline at end of file diff --git a/src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj b/src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj index 8f4bcbe92..906ff9f17 100644 --- a/src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj +++ b/src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 true AutoMapper.Extensions.Microsoft.DependencyInjection.Tests AutoMapper.Extensions.Microsoft.DependencyInjection.Tests @@ -19,7 +19,7 @@ - + diff --git a/src/AutoMapper/ApiCompat/PreBuild.sh b/src/AutoMapper/ApiCompat/PreBuild.sh old mode 100644 new mode 100755 index 3f611f576..8aebb86d2 --- a/src/AutoMapper/ApiCompat/PreBuild.sh +++ b/src/AutoMapper/ApiCompat/PreBuild.sh @@ -11,5 +11,16 @@ fi oldVersion="$oldVersion.0.0" echo $oldVersion rm -rf ../LastMajorVersionBinary -curl https://globalcdn.nuget.org/packages/automapper.$oldVersion.nupkg --create-dirs -o ../LastMajorVersionBinary/automapper.$oldVersion.nupkg -unzip -j ../LastMajorVersionBinary/automapper.$oldVersion.nupkg lib/netstandard2.1/AutoMapper.dll -d ../LastMajorVersionBinary +mkdir -p ../LastMajorVersionBinary +nupkg=../LastMajorVersionBinary/automapper.$oldVersion.nupkg +curl https://globalcdn.nuget.org/packages/automapper.$oldVersion.nupkg --create-dirs -o "$nupkg" +# Prefer a modern netX.Y contract; fall back to whatever lib TFM the package ships. +dll=$(unzip -Z1 "$nupkg" | awk '/^lib\/net[0-9].*\/AutoMapper\.dll$/ { print; exit }') +if [[ -z "$dll" ]]; then + dll=$(unzip -Z1 "$nupkg" | awk '/^lib\/.*\/AutoMapper\.dll$/ { print; exit }') +fi +if [[ -z "$dll" ]]; then + echo "AutoMapper.dll was not found in $nupkg" >&2 + exit 1 +fi +unzip -j "$nupkg" "$dll" -d ../LastMajorVersionBinary diff --git a/src/AutoMapper/ApiCompatBaseline.txt b/src/AutoMapper/ApiCompatBaseline.txt index a048699c6..ee6b7066f 100644 --- a/src/AutoMapper/ApiCompatBaseline.txt +++ b/src/AutoMapper/ApiCompatBaseline.txt @@ -1,37 +1,5 @@ Compat issues with assembly AutoMapper: CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.AutoMapAttribute' changed from '[AttributeUsageAttribute(1036, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct, AllowMultiple=true)]' in the implementation. -CannotSealType : Type 'AutoMapper.AutoMapperConfigurationException.TypeMapConfigErrors' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -TypeCannotChangeClassification : Type 'AutoMapper.AutoMapperConfigurationException.TypeMapConfigErrors' is a 'struct' in the implementation but is a 'class' in the contract. -CannotSealType : Type 'AutoMapper.DuplicateTypeMapConfigurationException.TypeMapConfigErrors' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -TypeCannotChangeClassification : Type 'AutoMapper.DuplicateTypeMapConfigurationException.TypeMapConfigErrors' is a 'struct' in the implementation but is a 'class' in the contract. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapper' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapper.Map(System.Object, System.Object, System.Type, System.Type, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'opts' on member 'AutoMapper.IMapper.Map(System.Object, System.Object, System.Type, System.Type, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapper.Map(System.Object, System.Type, System.Type, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'destinationType' on member 'AutoMapper.IMapper.Map(System.Object, System.Type, System.Type, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'opts' on member 'AutoMapper.IMapper.Map(System.Object, System.Type, System.Type, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapper.Map(System.Object, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'opts' on member 'AutoMapper.IMapper.Map(System.Object, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapper.Map(TSource, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'opts' on member 'AutoMapper.IMapper.Map(TSource, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapper.Map(TSource, TDestination, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'opts' on member 'AutoMapper.IMapper.Map(TSource, TDestination, System.Action>)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'parameters' on member 'AutoMapper.IMapper.ProjectTo(System.Linq.IQueryable, System.Type, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'parameters' on member 'AutoMapper.IMapper.ProjectTo(System.Linq.IQueryable, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.IMapper.ProjectTo(System.Linq.IQueryable, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'parameters' on member 'AutoMapper.IMapper.ProjectTo(System.Linq.IQueryable, System.Object, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.IMapper.ProjectTo(System.Linq.IQueryable, System.Object, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.IMapperBase' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'destinationType' on member 'AutoMapper.IMapperBase.Map(System.Object, System.Type, System.Type)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.ResolutionContext.AutoMapper.IMapperBase.Map(System.Object)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TSource' on member 'AutoMapper.ResolutionContext.AutoMapper.IMapperBase.Map(TSource)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.ResolutionContext.AutoMapper.IMapperBase.Map(TSource)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TSource' on member 'AutoMapper.ResolutionContext.AutoMapper.IMapperBase.Map(TSource, TDestination)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.ResolutionContext.AutoMapper.IMapperBase.Map(TSource, TDestination)' in the contract but not the implementation. -MembersMustExist : Member 'public void AutoMapper.Configuration.MappingExpression..ctor(AutoMapper.Internal.TypePair, AutoMapper.MemberList)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'public void AutoMapper.Configuration.MappingExpression..ctor(AutoMapper.MemberList, System.Type, System.Type)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'protected void AutoMapper.Configuration.MappingExpressionBase..ctor(AutoMapper.MemberList, System.Type, System.Type)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'public void AutoMapper.Configuration.ValidationContext..ctor(AutoMapper.Internal.TypePair, AutoMapper.MemberMap, AutoMapper.TypeMap, AutoMapper.Internal.Mappers.IObjectMapper)' does not exist in the implementation but it does exist in the contract. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.Configuration.Annotations.IgnoreAttribute' changed from '[AttributeUsageAttribute(384)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.Configuration.Annotations.MapAtRuntimeAttribute' changed from '[AttributeUsageAttribute(384)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.Configuration.Annotations.MappingOrderAttribute' changed from '[AttributeUsageAttribute(384)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]' in the implementation. @@ -40,34 +8,4 @@ CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMappe CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.Configuration.Annotations.UseExistingValueAttribute' changed from '[AttributeUsageAttribute(384)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.Configuration.Annotations.ValueConverterAttribute' changed from '[AttributeUsageAttribute(384)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'AutoMapper.Configuration.Annotations.ValueResolverAttribute' changed from '[AttributeUsageAttribute(384)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property)]' in the implementation. -CannotSealType : Type 'AutoMapper.Internal.Mappers.AssignableMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.CollectionMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ConstructorMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ConversionOperatorMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ConvertMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.EnumToEnumMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.FromDynamicMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.FromStringDictionaryMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.KeyValueMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.MultidimensionalArrayFiller' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -TypeCannotChangeClassification : Type 'AutoMapper.Internal.Mappers.MultidimensionalArrayFiller' is a 'struct' in the implementation but is a 'class' in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.NullableDestinationMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.NullableSourceMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ParseStringMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.StringToEnumMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ToDynamicMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ToStringDictionaryMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.ToStringMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotSealType : Type 'AutoMapper.Internal.Mappers.UnderlyingTypeEnumMapper' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, System.Type, AutoMapper.IConfigurationProvider)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, System.Type, AutoMapper.IConfigurationProvider, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'parameters' on member 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, System.Type, AutoMapper.IConfigurationProvider, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'parameters' on member 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Collections.Generic.IDictionary, System.String[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Object, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on parameter 'parameters' on member 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Object, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableAttribute' exists on generic param 'TDestination' on member 'AutoMapper.QueryableExtensions.Extensions.ProjectTo(System.Linq.IQueryable, AutoMapper.IConfigurationProvider, System.Object, System.Linq.Expressions.Expression>[])' in the contract but not the implementation. -Total Issues: 71 +Total Issues: 9 diff --git a/src/AutoMapper/AutoMapper.csproj b/src/AutoMapper/AutoMapper.csproj index 24c7ce93e..3598bea53 100644 --- a/src/AutoMapper/AutoMapper.csproj +++ b/src/AutoMapper/AutoMapper.csproj @@ -3,7 +3,7 @@ A convention-based object-object mapper. A convention-based object-object mapper. - net8.0 + net10.0 true AutoMapper ..\..\AutoMapper.snk @@ -38,9 +38,9 @@ - + - + diff --git a/src/Benchmark/Benchmark.csproj b/src/Benchmark/Benchmark.csproj index 338eb6067..0667bca2d 100644 --- a/src/Benchmark/Benchmark.csproj +++ b/src/Benchmark/Benchmark.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 Exe diff --git a/src/IntegrationTests/AutoMapper.IntegrationTests.csproj b/src/IntegrationTests/AutoMapper.IntegrationTests.csproj index 910df8148..fbed05eba 100644 --- a/src/IntegrationTests/AutoMapper.IntegrationTests.csproj +++ b/src/IntegrationTests/AutoMapper.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 $(NoWarn);618 @@ -10,7 +10,8 @@ - + + diff --git a/src/TestApp/TestApp.csproj b/src/TestApp/TestApp.csproj index 43d1d1168..d13aee6fb 100644 --- a/src/TestApp/TestApp.csproj +++ b/src/TestApp/TestApp.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 TestApp Exe enable @@ -13,7 +13,7 @@ - + diff --git a/src/UnitTests/AutoMapper.UnitTests.csproj b/src/UnitTests/AutoMapper.UnitTests.csproj index 8c9650883..51819156f 100644 --- a/src/UnitTests/AutoMapper.UnitTests.csproj +++ b/src/UnitTests/AutoMapper.UnitTests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 $(NoWarn);649;618