Skip to content

Commit

Permalink
Merge branch 'icsharpcode:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dbCF authored Nov 29, 2024
2 parents 51e377f + 30cad99 commit 32d2cf6
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;net7.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net6.0-windows;net8.0-windows;net472</TargetFrameworks>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<DefineConstants>TRACE</DefineConstants>
Expand All @@ -17,7 +17,7 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0-windows' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0-windows' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net472' ">
Expand Down
12 changes: 6 additions & 6 deletions ICSharpCode.AvalonEdit.Tests/ICSharpCode.AvalonEdit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0-windows;net7.0-windows;net462</TargetFrameworks>
<TargetFrameworks>net6.0-windows;net8.0-windows;net462</TargetFrameworks>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<DefineConstants>TRACE</DefineConstants>
Expand All @@ -16,18 +16,18 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0-windows' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0-windows' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj" />
Expand Down
19 changes: 17 additions & 2 deletions ICSharpCode.AvalonEdit.Tests/MultipleUIThreads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System;
using System.Threading;
using System.Windows;

using NUnit.Framework;

namespace ICSharpCode.AvalonEdit
Expand All @@ -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()
{
Expand All @@ -42,7 +57,7 @@ public void CreateEditorInstancesOnMultipleUIThreads()
if (error != null)
throw new InvalidOperationException(error.Message, error);
}
#endif
[STAThread]
void Run()
{
Expand Down
3 changes: 2 additions & 1 deletion ICSharpCode.AvalonEdit/Editing/DragDropException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ public DragDropException(string message) : base(message)
public DragDropException(string message, Exception innerException) : base(message, innerException)
{
}

#if !NET6_0_OR_GREATER
/// <summary>
/// Deserializes a DragDropException.
/// </summary>
protected DragDropException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endif
}
}
9 changes: 8 additions & 1 deletion ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ public HighlightingDefinitionInvalidException(string message) : base(message)
public HighlightingDefinitionInvalidException(string message, Exception innerException) : base(message, innerException)
{
}

#if !NET6_0_OR_GREATER
/// <summary>
/// Creates a new HighlightingDefinitionInvalidException instance.
/// </summary>
protected HighlightingDefinitionInvalidException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endif
}
}
4 changes: 2 additions & 2 deletions ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0-windows;net7.0-windows;net462</TargetFrameworks>
<TargetFrameworks>net6.0-windows;net8.0-windows;net462</TargetFrameworks>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<DefineConstants>TRACE</DefineConstants>
Expand Down Expand Up @@ -43,7 +43,7 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0-windows' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0-windows' ">
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ public VisualLinesInvalidException(string message) : base(message)
public VisualLinesInvalidException(string message, Exception innerException) : base(message, innerException)
{
}

#if !NET6_0_OR_GREATER
/// <summary>
/// Creates a new VisualLinesInvalidException instance.
/// </summary>
protected VisualLinesInvalidException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endif
}
}
3 changes: 2 additions & 1 deletion ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// <inheritdoc/>
protected SearchPatternException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endif
}
}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "major",
"allowPrerelease": true
}
Expand Down

0 comments on commit 32d2cf6

Please sign in to comment.