This is an automated email from the ASF dual-hosted git repository. FreeAndNil pushed a commit to branch Feature/305-dotnet-10-build-cleanup in repository https://gitbox.apache.org/repos/asf/logging-log4net.git
commit 14f09c09d2551b0010802dce56c283fc93cff75e Author: Jan Friedrich <[email protected]> AuthorDate: Tue Aug 4 23:24:15 2026 +0200 Target .NET 10 / C# 14 for tests The sources use C# 14, so a .NET 10 SDK is now required. Test and integration-test projects move from net8.0 to net10.0; the shipped log4net assembly keeps net462;netstandard2.0. --- .github/workflows/build.yaml | 2 +- src/changelog/3.4.0/305-target-dotnet-10.xml | 13 +++++++++++++ .../log4net-611-main/log4net-611-main.csproj | 2 +- src/integration-testing/log4net-672/log4net-672.csproj | 2 +- src/integration-testing/log4net-673/log4net-673.csproj | 2 +- src/integration-testing/log4net-681/log4net-681.csproj | 2 +- src/log4net.Ext.Mail.Tests/log4net.Ext.Mail.Tests.csproj | 2 +- src/log4net.Tests/log4net.Tests.csproj | 9 ++++++--- 8 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 86205a46..f25255cc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -47,7 +47,7 @@ jobs: - name: Set up dotnet uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # 4.0.1 with: - dotnet-version: 8 + dotnet-version: 10 dotnet-quality: ga - name: Build diff --git a/src/changelog/3.4.0/305-target-dotnet-10.xml b/src/changelog/3.4.0/305-target-dotnet-10.xml new file mode 100644 index 00000000..e2ca2d75 --- /dev/null +++ b/src/changelog/3.4.0/305-target-dotnet-10.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="https://logging.apache.org/xml/ns" + xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" + type="changed"> + <issue id="305" link="https://github.com/apache/logging-log4net/pull/305"/> + <description format="asciidoc"> + build and test with .NET 10: the test and integration-test projects now target `net10.0` + instead of `net8.0`, and a .NET 10 SDK is required because the sources use C# 14 language + features. The published `log4net` assembly still targets `net462` and `netstandard2.0`, so + nothing changes for consumers + </description> +</entry> diff --git a/src/integration-testing/log4net-611-main/log4net-611-main.csproj b/src/integration-testing/log4net-611-main/log4net-611-main.csproj index 644a5226..ce5ad80f 100644 --- a/src/integration-testing/log4net-611-main/log4net-611-main.csproj +++ b/src/integration-testing/log4net-611-main/log4net-611-main.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFrameworks>net462;net8.0</TargetFrameworks> + <TargetFrameworks>net462;net10.0</TargetFrameworks> <RootNamespace>log4net_611_main</RootNamespace> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> diff --git a/src/integration-testing/log4net-672/log4net-672.csproj b/src/integration-testing/log4net-672/log4net-672.csproj index 7905ac11..33f8839b 100644 --- a/src/integration-testing/log4net-672/log4net-672.csproj +++ b/src/integration-testing/log4net-672/log4net-672.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net8.0</TargetFramework> + <TargetFramework>net10.0</TargetFramework> <RootNamespace>log4net_672</RootNamespace> <ImplicitUsings>disable</ImplicitUsings> <Nullable>enable</Nullable> diff --git a/src/integration-testing/log4net-673/log4net-673.csproj b/src/integration-testing/log4net-673/log4net-673.csproj index 8521944b..ed237a8c 100644 --- a/src/integration-testing/log4net-673/log4net-673.csproj +++ b/src/integration-testing/log4net-673/log4net-673.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net8.0</TargetFramework> + <TargetFramework>net10.0</TargetFramework> <RootNamespace>log4net_673</RootNamespace> <ImplicitUsings>disable</ImplicitUsings> <Nullable>disable</Nullable> diff --git a/src/integration-testing/log4net-681/log4net-681.csproj b/src/integration-testing/log4net-681/log4net-681.csproj index 238e930b..8cdaa70e 100644 --- a/src/integration-testing/log4net-681/log4net-681.csproj +++ b/src/integration-testing/log4net-681/log4net-681.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net8.0</TargetFramework> + <TargetFramework>net10.0</TargetFramework> <RootNamespace>log4net_681</RootNamespace> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> diff --git a/src/log4net.Ext.Mail.Tests/log4net.Ext.Mail.Tests.csproj b/src/log4net.Ext.Mail.Tests/log4net.Ext.Mail.Tests.csproj index 0add8141..6507ad71 100644 --- a/src/log4net.Ext.Mail.Tests/log4net.Ext.Mail.Tests.csproj +++ b/src/log4net.Ext.Mail.Tests/log4net.Ext.Mail.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <IsTestProject>true</IsTestProject> - <TargetFrameworks>net8.0</TargetFrameworks> + <TargetFrameworks>net10.0</TargetFrameworks> <NoWarn>NETSDK1138;CS1701</NoWarn> <OutputType>Library</OutputType> <OutputPath>bin\$(Configuration)</OutputPath> diff --git a/src/log4net.Tests/log4net.Tests.csproj b/src/log4net.Tests/log4net.Tests.csproj index 368fd27e..1ce53b95 100644 --- a/src/log4net.Tests/log4net.Tests.csproj +++ b/src/log4net.Tests/log4net.Tests.csproj @@ -1,7 +1,11 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <IsTestProject>true</IsTestProject> - <TargetFrameworks>net462;net8.0</TargetFrameworks> + <TargetFrameworks>net462;net10.0</TargetFrameworks> + <!-- net462 test assemblies can only be executed on Windows: VSTest hosts them through + TestHostNetFramework/testhost.exe, which is not part of the Linux/macOS SDK. Building + them elsewhere only produces assemblies that cannot be run, so skip the target. --> + <TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net10.0</TargetFrameworks> <NoWarn>NETSDK1138;CS1701</NoWarn> <OutputType>Library</OutputType> <OutputPath>bin\$(Configuration)</OutputPath> @@ -31,7 +35,7 @@ <Reference Include="System.Configuration" /> <Reference Include="System.Runtime.Remoting" /> </ItemGroup> - <ItemGroup Condition="'$(TargetFramework)'=='net8.0'"> + <ItemGroup Condition="'$(TargetFramework)'=='net10.0'"> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNetTestSdkPackageVersion)" /> </ItemGroup> <ItemGroup> @@ -39,5 +43,4 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> - <Import Project="../MonoForFramework.targets" /> </Project> \ No newline at end of file
