From c4d79c6111952ea5ac6738b3c9483f1f7832af53 Mon Sep 17 00:00:00 2001 From: andy83 Date: Sun, 23 Aug 2026 19:45:57 +0200 Subject: [PATCH 1/2] Modernize Idmr.Platform for .NET 10 --- .github/workflows/build.yml | 34 ++++++++ EncodingSupport.cs | 14 +++ Platform.csproj | 168 +++++------------------------------- Properties/AssemblyInfo.cs | 4 +- Tie/MessageCollection.cs | 6 +- Xvt/MessageCollection.cs | 6 +- 6 files changed, 74 insertions(+), 158 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 EncodingSupport.cs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..49bfd36 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build + +on: + push: + branches: [master, xvtsharp/net10] + pull_request: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + with: + path: idmr-platform + + - uses: actions/checkout@v5 + with: + repository: andy83/LdmrCommon + ref: f8fdb256d6180aeed58c73ec2b426bb43c630cde + path: idmr-common + + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.0.x + + - name: Restore + run: dotnet restore idmr-platform/Platform.csproj + + - name: Build + run: dotnet build idmr-platform/Platform.csproj --no-restore --configuration Release diff --git a/EncodingSupport.cs b/EncodingSupport.cs new file mode 100644 index 0000000..9a8601c --- /dev/null +++ b/EncodingSupport.cs @@ -0,0 +1,14 @@ +using System.Runtime.CompilerServices; +using System.Text; + +namespace Idmr.Platform +{ + internal static class EncodingSupport + { + [ModuleInitializer] + internal static void RegisterCodePages() + { + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + } + } +} diff --git a/Platform.csproj b/Platform.csproj index dfd6f1a..41439a0 100644 --- a/Platform.csproj +++ b/Platform.csproj @@ -1,153 +1,25 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {ABE8BD2A-CFA2-4912-B635-AC7C52F81434} - Library - Properties - Idmr.Platform + net10.0 Idmr.Platform - v4.8 - 512 - - - - - 3.5 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Idmr.Platform.XML - false + Idmr.Platform + false + true + disable + disable + + + false + false + false + false + $(NoWarn);CS1591 + + ../idmr-common/Common.csproj + - - False - ..\..\..\Libraries\Idmr.Common.dll - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - + + - - - - copy /y "$(TargetPath)" "C:\Users\Me\Documents\Visual Studio 2008\Libraries\" -if $(ConfigurationName) == Release copy /y "$(TargetDir)$(TargetName).xml" "C:\Users\Me\Documents\Visual Studio 2008\Libraries\" - - \ No newline at end of file + diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 575f424..d85b6bc 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -20,6 +20,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("7.4.1.*")] +[assembly: AssemblyVersion("7.4.1.0")] [assembly: AssemblyFileVersion("7.4.1.0")] -[assembly: AssemblyInformationalVersion("7.4 final")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("7.4 final")] diff --git a/Tie/MessageCollection.cs b/Tie/MessageCollection.cs index bf4422f..a5e9c6e 100644 --- a/Tie/MessageCollection.cs +++ b/Tie/MessageCollection.cs @@ -18,7 +18,6 @@ using System; using System.Collections.Generic; -using System.Windows.Forms; namespace Idmr.Platform.Tie { @@ -36,12 +35,11 @@ public MessageCollection() /// Creates a new Collection with multiple initial Messages. /// Number of Messages to start with. /// is less than 0. - /// Exceeding will result in a warning and the excess ignored. + /// Exceeding trims the excess. public MessageCollection(int quantity) : this() { if (quantity > _itemLimit) { - MessageBox.Show($"Maximum quantity ({_itemLimit}) exceeded, trimming excess.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); quantity = _itemLimit; } if (quantity < 0) throw new ArgumentOutOfRangeException("quantity", "Invalid quantity, must be 0-" + _itemLimit); @@ -132,4 +130,4 @@ public override void SetCount(int value, bool allowTruncate) else while (Count < value) Add(); } } -} \ No newline at end of file +} diff --git a/Xvt/MessageCollection.cs b/Xvt/MessageCollection.cs index 36afe59..bb10576 100644 --- a/Xvt/MessageCollection.cs +++ b/Xvt/MessageCollection.cs @@ -18,7 +18,6 @@ using System; using System.Collections.Generic; -using System.Windows.Forms; namespace Idmr.Platform.Xvt { @@ -36,12 +35,11 @@ public MessageCollection() /// Creates a new Collection with multiple initial Messages. /// Number of Messages to start with. /// is less than 0. - /// Exceeding will result in a warning and the excess ignored. + /// Exceeding trims the excess. public MessageCollection(int quantity) : this() { if (quantity > _itemLimit) { - MessageBox.Show($"Maximum quantity ({_itemLimit}) exceeded, trimming excess.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); quantity = _itemLimit; } if (quantity < 0) throw new ArgumentOutOfRangeException("quantity", "Invalid quantity, must be 0-" + _itemLimit); @@ -131,4 +129,4 @@ public override void SetCount(int value, bool allowTruncate) else while (Count < value) Add(); } } -} \ No newline at end of file +} From 30da3770ccc72c620e5fc273e958ae5324bd014b Mon Sep 17 00:00:00 2001 From: andy83 Date: Sun, 23 Aug 2026 20:06:41 +0200 Subject: [PATCH 2/2] Clean up .NET 10 compatibility warnings --- .github/workflows/build.yml | 2 +- Platform.csproj | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49bfd36..07b1ce0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v5 with: repository: andy83/LdmrCommon - ref: f8fdb256d6180aeed58c73ec2b426bb43c630cde + ref: db9b9d7af6d7946ba5d9089245ec33504bd0a586 path: idmr-common - uses: actions/setup-dotnet@v5 diff --git a/Platform.csproj b/Platform.csproj index 41439a0..53e0020 100644 --- a/Platform.csproj +++ b/Platform.csproj @@ -13,13 +13,12 @@ false false false - $(NoWarn);CS1591 + $(NoWarn);CS0419;CS1591 ../idmr-common/Common.csproj -