diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 75e2de7b..dce37fe6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -27,10 +27,10 @@ jobs: assemblyVersion: ${{ env.BuildVersion }}.${{ github.run_number }} fileVersion: ${{ env.BuildVersion }}.${{ github.run_number }} - - name: Setup .NET 7 + - name: Setup .NET 8.0 uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Setup LTS .NET uses: actions/setup-dotnet@v3 @@ -53,10 +53,10 @@ jobs: env: TestAssembly: ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net6.0-windows\ICSharpCode.AvalonEdit.Tests.dll - - name: net7.0-windows Unit Tests + - name: net8.0-windows Unit Tests run: vstest.console $env:TestAssembly env: - TestAssembly: ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net7.0-windows\ICSharpCode.AvalonEdit.Tests.dll + TestAssembly: ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net8.0-windows\ICSharpCode.AvalonEdit.Tests.dll - name: net462 Unit Tests run: vstest.console $env:TestAssembly diff --git a/ICSharpCode.AvalonEdit.Sample/ICSharpCode.AvalonEdit.Sample.csproj b/ICSharpCode.AvalonEdit.Sample/ICSharpCode.AvalonEdit.Sample.csproj index f9c72545..513fefb4 100644 --- a/ICSharpCode.AvalonEdit.Sample/ICSharpCode.AvalonEdit.Sample.csproj +++ b/ICSharpCode.AvalonEdit.Sample/ICSharpCode.AvalonEdit.Sample.csproj @@ -1,7 +1,7 @@  WinExe - net6.0-windows;net7.0-windows;net472 + net6.0-windows;net8.0-windows;net472 true true TRACE @@ -17,7 +17,7 @@ TRACE - + TRACE diff --git a/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj b/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj index 97fff5db..4a7ccf17 100644 --- a/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj +++ b/ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj @@ -1,7 +1,7 @@  Library - net6.0-windows;net7.0-windows;net462 + net6.0-windows;net8.0-windows;net462 true true TRACE @@ -16,7 +16,7 @@ TRACE - + TRACE @@ -24,10 +24,10 @@ - - - - + + + + diff --git a/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs b/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs index 92613b04..df79ac91 100644 --- a/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs +++ b/ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs @@ -19,6 +19,7 @@ using System; using System.Threading; using System.Windows; + using NUnit.Framework; namespace ICSharpCode.AvalonEdit @@ -27,7 +28,21 @@ namespace ICSharpCode.AvalonEdit public class MultipleUIThreads { Exception error; - + + /* NET80 error on GH CI: + The active test run was aborted. Reason: Test host process crashed : Process terminated. Encountered infinite recursion while looking up resource 'Arg_NullReferenceException' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted. + at System.Environment.FailFast(System.String) + at System.SR.InternalGetResourceString(System.String) + at System.SR.GetResourceString(System.String) + at System.NullReferenceException..ctor() + at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo) + at System.SR.InternalGetResourceString(System.String) + at System.SR.GetResourceString(System.String) + at System.NullReferenceException..ctor() + at System.Threading.Thread.get_CurrentThread() + at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) + */ +#if !NET8_0_OR_GREATER [Test] public void CreateEditorInstancesOnMultipleUIThreads() { @@ -42,7 +57,7 @@ public void CreateEditorInstancesOnMultipleUIThreads() if (error != null) throw new InvalidOperationException(error.Message, error); } - +#endif [STAThread] void Run() { diff --git a/ICSharpCode.AvalonEdit/Editing/DragDropException.cs b/ICSharpCode.AvalonEdit/Editing/DragDropException.cs index c3417887..1b6d28bc 100644 --- a/ICSharpCode.AvalonEdit/Editing/DragDropException.cs +++ b/ICSharpCode.AvalonEdit/Editing/DragDropException.cs @@ -50,12 +50,13 @@ public DragDropException(string message) : base(message) public DragDropException(string message, Exception innerException) : base(message, innerException) { } - +#if !NET6_0_OR_GREATER /// /// Deserializes a DragDropException. /// protected DragDropException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs b/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs index b7033c4c..3e468087 100644 --- a/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs +++ b/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs @@ -116,7 +116,14 @@ public static ITfThreadMgr GetTextFrameworkThreadManager() { if (!textFrameworkThreadMgrInitialized) { textFrameworkThreadMgrInitialized = true; - TF_CreateThreadMgr(out textFrameworkThreadMgr); + try + { + TF_CreateThreadMgr(out textFrameworkThreadMgr); + } + catch + { + // The call will fail if the current runtime doesn't have COM interop + } } return textFrameworkThreadMgr; } diff --git a/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs b/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs index 2cb3679a..c05b3415 100644 --- a/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs +++ b/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs @@ -47,12 +47,13 @@ public HighlightingDefinitionInvalidException(string message) : base(message) public HighlightingDefinitionInvalidException(string message, Exception innerException) : base(message, innerException) { } - +#if !NET6_0_OR_GREATER /// /// Creates a new HighlightingDefinitionInvalidException instance. /// protected HighlightingDefinitionInvalidException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj b/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj index 18f55820..bb14a530 100644 --- a/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj +++ b/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj @@ -1,7 +1,7 @@  Library - net6.0-windows;net7.0-windows;net462 + net6.0-windows;net8.0-windows;net462 true true TRACE @@ -43,7 +43,7 @@ TRACE - + TRACE diff --git a/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs b/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs index 79b85cb8..add5db6b 100644 --- a/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs +++ b/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs @@ -48,12 +48,13 @@ public VisualLinesInvalidException(string message) : base(message) public VisualLinesInvalidException(string message, Exception innerException) : base(message, innerException) { } - +#if !NET6_0_OR_GREATER /// /// Creates a new VisualLinesInvalidException instance. /// protected VisualLinesInvalidException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs b/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs index 74bea578..05f31fd5 100644 --- a/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs +++ b/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs @@ -93,11 +93,12 @@ public SearchPatternException(string message) : base(message) public SearchPatternException(string message, Exception innerException) : base(message, innerException) { } - +#if !NET6_0_OR_GREATER // This constructor is needed for serialization. /// protected SearchPatternException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/global.json b/global.json index 1fcfe4fe..6a5d4bad 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "major", "allowPrerelease": true }