From a3edd340d6ed6bae644c27bb622b841db24faa3e Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 17 Nov 2024 19:47:20 +0000 Subject: [PATCH 1/2] Update Build to allow for Net 9.0 --- .github/workflows/ci-build.yml | 3 ++- .github/workflows/release.yml | 3 ++- src/global.json | 4 ---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index bd993413a..537616b48 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -21,13 +21,14 @@ jobs: fetch-depth: 0 lfs: true - - name: Setup .NET 6/7 + - name: Setup .NET 6/7/8/9 uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x 7.0.x 8.0.x + 9.0.x - name: NBGV id: nbgv diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96948b6cd..5f4d8f730 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,13 +22,14 @@ jobs: with: fetch-depth: 0 - - name: Setup .NET 6/7 + - name: Setup .NET 6/7/8/9 uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x 7.0.x 8.0.x + 9.0.x - name: NBGV id: nbgv diff --git a/src/global.json b/src/global.json index 2354d9989..5cfa01d9c 100644 --- a/src/global.json +++ b/src/global.json @@ -1,8 +1,4 @@ { - "sdk": { - "version": "8.0.401", - "rollForward": "latestMinor" - }, "msbuild-sdks": { "MSBuild.Sdk.Extras": "3.0.44" } From 7897593f959ce453586b4caa80effe06d8dc4bd5 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 17 Nov 2024 20:12:14 +0000 Subject: [PATCH 2/2] Update Tests to Suppress NotImplementedException's --- NonProduction/DynamicData.Profile/DynamicData.Profile.csproj | 2 +- src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs | 1 + src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs | 1 + src/DynamicData.Tests/Domain/MarketPrice.cs | 1 + src/DynamicData.Tests/Utilities/ComparerExtensions.cs | 2 ++ 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj b/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj index 1ff699bf8..3757ec664 100644 --- a/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj +++ b/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 $(NoWarn);CS0618 diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index 1aa24f68d..280f7db33 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -190,6 +190,7 @@ private class PersonComparer : IEqualityComparer { public bool Equals([DisallowNull] Person x, [DisallowNull] Person y) => EqualityComparer.Default.Equals(x.Name, y.Name) && EqualityComparer.Default.Equals(x.Id, y.Id); + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "Suppressed for Net 9.0")] public int GetHashCode([DisallowNull] Person obj) => throw new NotImplementedException(); } diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index 1d041df21..d4ea2fd7e 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -291,6 +291,7 @@ private class KeyValueCompare(IEqualityComparer stringComparer) : IEqual private IEqualityComparer _stringComparer = stringComparer; public bool Equals([DisallowNull] KeyValuePair x, [DisallowNull] KeyValuePair y) => _stringComparer.Equals(x.Value, y.Value); + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "Suppressed for Net 9.0")] public int GetHashCode([DisallowNull] KeyValuePair obj) => throw new NotImplementedException(); } diff --git a/src/DynamicData.Tests/Domain/MarketPrice.cs b/src/DynamicData.Tests/Domain/MarketPrice.cs index e75181d7a..f8fb2c6ad 100644 --- a/src/DynamicData.Tests/Domain/MarketPrice.cs +++ b/src/DynamicData.Tests/Domain/MarketPrice.cs @@ -56,6 +56,7 @@ public decimal Price private class CurrentPriceEqualityComparer : IEqualityComparer { public virtual bool Equals([DisallowNull] MarketPrice x, [DisallowNull] MarketPrice y) => x.MarketId.Equals(x.MarketId) && x.ItemId == y.ItemId && x.Price == y.Price; + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "Suppressed for Net 9.0")] public int GetHashCode([DisallowNull] MarketPrice obj) => throw new NotImplementedException(); } diff --git a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs index f14dc74d2..76433346f 100644 --- a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs @@ -11,7 +11,9 @@ internal sealed class NoOpComparer : IComparer internal sealed class NoOpEqualityComparer : IEqualityComparer { + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "Suppressed for Net 9.0")] public bool Equals(T x, T y) => throw new NotImplementedException(); + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "Suppressed for Net 9.0")] public int GetHashCode([DisallowNull] T obj) => throw new NotImplementedException(); }