Upgrade projects to target .NET 10, add conditional System.Linq.Async dependencies for compatibility with earlier frameworks, and update project files for consistency across the solution. (#7062)

* Upgrade projects to target .NET 10, add conditional `System.Linq.Async` dependencies for compatibility with earlier frameworks, and update project files for consistency across the solution.

* Suppress null comparison warning in `WorkflowDefinitionStore` and remove xUnit references from performance test project.

* Refactor performance test projects to remove xUnit references and update MSBuild properties for BenchmarkDotNet.
This commit is contained in:
Sipke Schoorstra 2025-11-21 20:55:30 +01:00 committed by GitHub
parent 5655192fb6
commit 2f9eac110e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 48 additions and 20 deletions

View file

@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup Label="TargetFrameworks">
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Label="Files">

View file

@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

View file

@ -9,6 +9,10 @@
<ItemGroup>
<PackageReference Include="Jint" />
</ItemGroup>
<!-- System.Linq.Async only for .NET 8 and 9 - .NET 10 has native async LINQ support -->
<ItemGroup Condition="'$(TargetFramework)' != 'net10.0'">
<PackageReference Include="System.Linq.Async" />
</ItemGroup>

View file

@ -221,7 +221,9 @@ public class EFCoreWorkflowDefinitionStore(EntityStore<ManagementElsaDbContext,
if (filter.IsSystem != null)
queryable = filter.IsSystem == true
? queryable.Where(x => x.IsSystem == true)
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
: queryable.Where(x => x.IsSystem == false || x.IsSystem == null!);
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
if (filter.IsReadonly != null) queryable = queryable.Where(x => x.IsReadonly == filter.IsReadonly);
return queryable;

View file

@ -19,6 +19,10 @@
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="ShortGuid" />
</ItemGroup>
<!-- System.Linq.Async only for .NET 8 and 9 - .NET 10 has native async LINQ support -->
<ItemGroup Condition="'$(TargetFramework)' != 'net10.0'">
<PackageReference Include="System.Linq.Async" />
</ItemGroup>

View file

@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>

View file

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

View file

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Include>[Elsa.Workflows.Core]*</Include>
<Threshold>25</Threshold>
</PropertyGroup>

View file

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Include>[Elsa.Expressions.JavaScript]*</Include>
</PropertyGroup>

View file

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Include>[Elsa.Resilience]*,[Elsa.Http]*,[Elsa.Workflows.Core]*</Include>
</PropertyGroup>

View file

@ -1,7 +1,37 @@
<Project>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet"/>
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<CollectCoverage>false</CollectCoverage>
<!-- This is a BenchmarkDotNet performance test, not an xUnit test -->
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<!-- Remove xUnit packages inherited from test/Directory.Build.props -->
<ItemGroup>
<PackageReference Remove="Microsoft.NET.Test.Sdk"/>
<PackageReference Remove="xunit"/>
<PackageReference Remove="xunit.runner.visualstudio"/>
<PackageReference Remove="Microsoft.AspNetCore.Mvc.Testing"/>
<PackageReference Remove="Moq"/>
<PackageReference Remove="NSubstitute"/>
<PackageReference Remove="coverlet.msbuild"/>
<PackageReference Remove="coverlet.collector"/>
<PackageReference Remove="GitHubActionsTestLogger"/>
</ItemGroup>
<!-- Remove xUnit usings -->
<ItemGroup>
<Using Remove="Xunit"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet"/>
</ItemGroup>
</Project>

View file

@ -1,14 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<CollectCoverage>false</CollectCoverage>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\modules\Elsa\Elsa.csproj" />