From acc22557568dfa64a2621aaf7d41d19bfd7d974b Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Thu, 13 Nov 2025 15:45:38 +0100 Subject: [PATCH 1/5] Adding support for .NET 10 --- .github/workflows/ci.yml | 2 ++ .github/workflows/release.yml | 2 ++ src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj | 4 ++-- src/AutoMapper/AutoMapper.csproj | 8 ++++---- src/Benchmark/Benchmark.csproj | 2 +- src/IntegrationTests/AutoMapper.IntegrationTests.csproj | 4 ++-- src/TestApp/TestApp.csproj | 4 ++-- src/UnitTests/AutoMapper.UnitTests.csproj | 4 ++-- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8c8f8f1bb..289db94912 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Build and Test run: ./Build.ps1 shell: pwsh @@ -49,6 +50,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Build and Test run: ./Build.ps1 shell: pwsh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e434574c3..b36d61c8e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Build and Test run: ./Build.ps1 shell: pwsh @@ -40,6 +41,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Build and Test run: ./Build.ps1 shell: pwsh diff --git a/src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj b/src/AutoMapper.DI.Tests/AutoMapper.DI.Tests.csproj index 8f4bcbe920..1ae0467efc 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/AutoMapper.csproj b/src/AutoMapper/AutoMapper.csproj index 0e183d062c..4474733c0f 100644 --- a/src/AutoMapper/AutoMapper.csproj +++ b/src/AutoMapper/AutoMapper.csproj @@ -3,8 +3,8 @@ A convention-based object-object mapper. A convention-based object-object mapper. - netstandard2.0;net8.0;net9.0 - 13.0 + netstandard2.0;net8.0;net9.0;net10.0 + 14.0 true AutoMapper ..\..\AutoMapper.snk @@ -44,8 +44,8 @@ - - + + diff --git a/src/Benchmark/Benchmark.csproj b/src/Benchmark/Benchmark.csproj index 338eb6067b..0667bca2d9 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 ccbd115d90..c45d47acaa 100644 --- a/src/IntegrationTests/AutoMapper.IntegrationTests.csproj +++ b/src/IntegrationTests/AutoMapper.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 $(NoWarn);618 ..\..\AutoMapper.snk true @@ -13,7 +13,7 @@ - + diff --git a/src/TestApp/TestApp.csproj b/src/TestApp/TestApp.csproj index 43d1d11683..8d7b9ec4b1 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 5e37fcc40c..12396e30d2 100644 --- a/src/UnitTests/AutoMapper.UnitTests.csproj +++ b/src/UnitTests/AutoMapper.UnitTests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 $(NoWarn);649;618 ..\..\AutoMapper.snk true @@ -14,7 +14,7 @@ - + From 0f6a19df70d875ff5268600b1e26ecb86d476583 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Fri, 14 Nov 2025 13:04:51 +0100 Subject: [PATCH 2/5] Fixing the build --- src/UnitTests/AutoMapper.UnitTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UnitTests/AutoMapper.UnitTests.csproj b/src/UnitTests/AutoMapper.UnitTests.csproj index 12396e30d2..4dc25a1377 100644 --- a/src/UnitTests/AutoMapper.UnitTests.csproj +++ b/src/UnitTests/AutoMapper.UnitTests.csproj @@ -1,7 +1,7 @@  - net10.0 + net10.0 $(NoWarn);649;618 ..\..\AutoMapper.snk true From 4ae77b6c65ec037ae30d64f7f4f2790c2801c030 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Mon, 17 Nov 2025 17:38:27 +0000 Subject: [PATCH 3/5] Fixing tuple issue --- src/UnitTests/AutoMapper.UnitTests.csproj | 4 ++++ src/UnitTests/Bug/MultiThreadingIssues.cs | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/UnitTests/AutoMapper.UnitTests.csproj b/src/UnitTests/AutoMapper.UnitTests.csproj index 4dc25a1377..505577ea4d 100644 --- a/src/UnitTests/AutoMapper.UnitTests.csproj +++ b/src/UnitTests/AutoMapper.UnitTests.csproj @@ -19,6 +19,10 @@ + + + + diff --git a/src/UnitTests/Bug/MultiThreadingIssues.cs b/src/UnitTests/Bug/MultiThreadingIssues.cs index 8bbf0e3145..7a4dbea989 100644 --- a/src/UnitTests/Bug/MultiThreadingIssues.cs +++ b/src/UnitTests/Bug/MultiThreadingIssues.cs @@ -642,7 +642,11 @@ public async Task Should_work() var tasks = types .Concat(types.Select(t => t.Reverse().ToArray())) - .Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1]))) + .Select(t=> new + { + SourceType = sourceType.MakeGenericType(t[0]), + DestinationType = destinationType.MakeGenericType(t[1]) + }) .ToArray() .Select(s => Task.Factory.StartNew(() => c.ResolveTypeMap(s.SourceType, s.DestinationType))) .ToArray(); @@ -1174,7 +1178,11 @@ public async Task Should_work() var tasks = types .Concat(types.Select(t => t.Reverse().ToArray())) - .Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1]))) + .Select(t=> new + { + SourceType = sourceType.MakeGenericType(t[0]), + DestinationType = destinationType.MakeGenericType(t[1]) + }) .ToArray() .Select(s => Task.Factory.StartNew(() => mapper.Map(null, s.SourceType, s.DestinationType))) .ToArray(); From 5b3871c5059f515075727ac3db6f6b6e21be04e8 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 19 Nov 2025 14:55:48 -0600 Subject: [PATCH 4/5] Revert "Fixing tuple issue" This reverts commit 4ae77b6c65ec037ae30d64f7f4f2790c2801c030. --- src/UnitTests/AutoMapper.UnitTests.csproj | 4 ---- src/UnitTests/Bug/MultiThreadingIssues.cs | 12 ++---------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/UnitTests/AutoMapper.UnitTests.csproj b/src/UnitTests/AutoMapper.UnitTests.csproj index 505577ea4d..4dc25a1377 100644 --- a/src/UnitTests/AutoMapper.UnitTests.csproj +++ b/src/UnitTests/AutoMapper.UnitTests.csproj @@ -19,10 +19,6 @@ - - - - diff --git a/src/UnitTests/Bug/MultiThreadingIssues.cs b/src/UnitTests/Bug/MultiThreadingIssues.cs index 7a4dbea989..8bbf0e3145 100644 --- a/src/UnitTests/Bug/MultiThreadingIssues.cs +++ b/src/UnitTests/Bug/MultiThreadingIssues.cs @@ -642,11 +642,7 @@ public async Task Should_work() var tasks = types .Concat(types.Select(t => t.Reverse().ToArray())) - .Select(t=> new - { - SourceType = sourceType.MakeGenericType(t[0]), - DestinationType = destinationType.MakeGenericType(t[1]) - }) + .Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1]))) .ToArray() .Select(s => Task.Factory.StartNew(() => c.ResolveTypeMap(s.SourceType, s.DestinationType))) .ToArray(); @@ -1178,11 +1174,7 @@ public async Task Should_work() var tasks = types .Concat(types.Select(t => t.Reverse().ToArray())) - .Select(t=> new - { - SourceType = sourceType.MakeGenericType(t[0]), - DestinationType = destinationType.MakeGenericType(t[1]) - }) + .Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1]))) .ToArray() .Select(s => Task.Factory.StartNew(() => mapper.Map(null, s.SourceType, s.DestinationType))) .ToArray(); From 2222d530fa204593734e9a7ee95d6ab97b5e59b6 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 19 Nov 2025 15:01:07 -0600 Subject: [PATCH 5/5] Fixing compile errors --- src/UnitTests/Bug/MultiThreadingIssues.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/UnitTests/Bug/MultiThreadingIssues.cs b/src/UnitTests/Bug/MultiThreadingIssues.cs index 8bbf0e3145..1caa962e30 100644 --- a/src/UnitTests/Bug/MultiThreadingIssues.cs +++ b/src/UnitTests/Bug/MultiThreadingIssues.cs @@ -1,4 +1,6 @@ -namespace AutoMapper.UnitTests.Bug; +using System.Linq; + +namespace AutoMapper.UnitTests.Bug; public class MultiThreadingIssues { public class Type1 @@ -641,7 +643,7 @@ public async Task Should_work() }; var tasks = types - .Concat(types.Select(t => t.Reverse().ToArray())) + .Concat(types.Select(t => Enumerable.Reverse(t).ToArray())) .Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1]))) .ToArray() .Select(s => Task.Factory.StartNew(() => c.ResolveTypeMap(s.SourceType, s.DestinationType))) @@ -1173,7 +1175,7 @@ public async Task Should_work() }; var tasks = types - .Concat(types.Select(t => t.Reverse().ToArray())) + .Concat(types.Select(t => Enumerable.Reverse(t).ToArray())) .Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1]))) .ToArray() .Select(s => Task.Factory.StartNew(() => mapper.Map(null, s.SourceType, s.DestinationType)))