From 47b102de6fb805a5cb482ab1fd4255c17cad6e7c Mon Sep 17 00:00:00 2001 From: Alex Yakunin Date: Wed, 9 Aug 2023 14:33:30 -0700 Subject: [PATCH] feat: .NET 8 preview support --- Directory.Build.props | 4 +-- Packages.props | 29 ++++++++++++------- Stl.Fusion.sln | 4 +-- samples/Directory.Build.props | 5 +++- samples/HelloCart/HelloCart.csproj | 9 ++++-- .../MiniRpc.csproj} | 10 ++++--- samples/{MiniRpcApp => MiniRpc}/Program.cs | 2 +- samples/{MiniRpcApp => MiniRpc}/Service.cs | 2 +- .../MultiServerRpc.csproj} | 8 +++-- .../Program.cs | 2 +- .../Service.cs | 2 +- src/Stl.CommandR/Stl.CommandR.csproj | 2 +- .../Stl.Fusion.Blazor.Authentication.csproj | 2 +- .../Stl.Fusion.Blazor.csproj | 8 ++++- .../Stl.Fusion.EntityFramework.Npgsql.csproj | 6 +++- .../Stl.Fusion.EntityFramework.Redis.csproj | 2 +- .../Stl.Fusion.EntityFramework.csproj | 11 ++++--- .../Stl.Fusion.Ext.Contracts.csproj | 2 +- .../Stl.Fusion.Ext.Services.csproj | 2 +- .../JsonifyErrorsAttribute.cs | 1 + .../Stl.Fusion.Server.NetFx.csproj | 11 ++----- .../TextMediaTypeFormatter.cs | 1 + .../UseDefaultSessionAttribute.cs | 1 + .../Stl.Fusion.Server.csproj | 6 +++- src/Stl.Fusion/Stl.Fusion.csproj | 9 ++++-- src/Stl.Generators/Stl.Generators.csproj | 2 +- src/Stl.Interception/Stl.Interception.csproj | 2 +- src/Stl.Plugins/Stl.Plugins.csproj | 3 +- src/Stl.Redis/Stl.Redis.csproj | 3 +- src/Stl.RestEase/Stl.RestEase.csproj | 3 +- .../Stl.Rpc.Server.NetFx.csproj | 11 ++----- src/Stl.Rpc.Server/Stl.Rpc.Server.csproj | 6 +++- src/Stl.Rpc/Stl.Rpc.csproj | 13 +++++---- src/Stl.Testing/Stl.Testing.csproj | 4 ++- src/Stl.Testing/TestWebHost.cs | 1 + src/Stl/Stl.csproj | 25 +++++++++++----- tests/Directory.Build.props | 2 +- ....Fusion.Tests.PerformanceTestRunner.csproj | 2 +- .../Authentication/AuthServiceTest.cs | 11 ------- tests/Stl.Fusion.Tests/FusionTestBase.cs | 4 --- .../Server/ExceptionContextFixture.cs | 3 +- .../Stl.Fusion.Tests/Stl.Fusion.Tests.csproj | 26 ++++++++++------- tests/Stl.Tests/Stl.Tests.csproj | 13 ++++++--- 43 files changed, 162 insertions(+), 113 deletions(-) rename samples/{MultiServerRpcApp/MultiServerRpcApp.csproj => MiniRpc/MiniRpc.csproj} (71%) rename samples/{MiniRpcApp => MiniRpc}/Program.cs (98%) rename samples/{MiniRpcApp => MiniRpc}/Service.cs (98%) rename samples/{MiniRpcApp/MiniRpcApp.csproj => MultiServerRpc/MultiServerRpc.csproj} (78%) rename samples/{MultiServerRpcApp => MultiServerRpc}/Program.cs (99%) rename samples/{MultiServerRpcApp => MultiServerRpc}/Service.cs (98%) diff --git a/Directory.Build.props b/Directory.Build.props index b97d138a1..923671ff4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -33,7 +33,7 @@ Library - latest + preview enable enable true @@ -45,7 +45,7 @@ true - + $(NoWarn);NU5048;NU5105;NETSDK1138 true diff --git a/Packages.props b/Packages.props index 11aac441f..61468b554 100644 --- a/Packages.props +++ b/Packages.props @@ -6,26 +6,32 @@ - 7.* + 8.0.0-preview.* + 7.* 6.* 5.* 3.* $(AspNetCoreVersion) + $(AspNetCoreVersion7) $(AspNetCoreVersion6) $(AspNetCoreVersion5) $(AspNetCoreVersion3) $(AspNetCoreVersion) + $(AspNetCoreVersion7) $(AspNetCoreVersion6) $(AspNetCoreVersion5) $(AspNetCoreVersion) + $(AspNetCoreVersion7) $(AspNetCoreVersion6) 4.4.* - 7.* + $(AspNetCoreVersion) + $(AspNetCoreVersion7) $(AspNetCoreVersion6) $(AspNetCoreVersion5) $(AspNetCoreVersion3) - 7.* + $(EntityFrameworkCoreVersion) + $(EntityFrameworkCoreVersion7) $(EntityFrameworkCoreVersion6) $(EntityFrameworkCoreVersion5) $(EntityFrameworkCoreVersion3) @@ -33,12 +39,14 @@ 2.1.* $(MySqlConnectorVersion6) 0.* - 7.0.* - $(AspNetCoreVersion6) - $(AspNetCoreVersion5) - $(AspNetCoreVersion3) + $(EntityFrameworkCoreVersion7) + $(EntityFrameworkCoreVersion7) + $(EntityFrameworkCoreVersion6) + $(EntityFrameworkCoreVersion5) + $(EntityFrameworkCoreVersion3) $(AspNetCoreVersion) + $(AspNetCoreVersion7) $(AspNetCoreVersion6) 13.0.* 1.9.* @@ -46,7 +54,8 @@ 1.6.* - $(AspNetCoreVersion6) + $(AspNetCoreVersion) + $(AspNetCoreVersion7) $(AspNetCoreVersion6) $(AspNetCoreVersion5) $(AspNetCoreVersion3) @@ -57,7 +66,7 @@ - + @@ -66,7 +75,6 @@ - @@ -125,6 +133,7 @@ + diff --git a/Stl.Fusion.sln b/Stl.Fusion.sln index e88979142..1d5bcf912 100644 --- a/Stl.Fusion.sln +++ b/Stl.Fusion.sln @@ -110,9 +110,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{91471F20-7 docs\TaskList-AY.md = docs\TaskList-AY.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniRpcApp", "samples\MiniRpcApp\MiniRpcApp.csproj", "{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniRpc", "samples\MiniRpc\MiniRpc.csproj", "{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiServerRpcApp", "samples\MultiServerRpcApp\MultiServerRpcApp.csproj", "{DDD38FE8-3105-44E6-9128-921B0713FF64}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiServerRpc", "samples\MultiServerRpc\MultiServerRpc.csproj", "{DDD38FE8-3105-44E6-9128-921B0713FF64}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 22b941cfc..d3742537f 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -1,11 +1,14 @@ + $(SolutionDir)artifacts\obj\$(MSBuildProjectName) $(SolutionDir)artifacts\samples\$(MSBuildProjectName) false false - net7.0 + net8.0 + preview + diff --git a/samples/HelloCart/HelloCart.csproj b/samples/HelloCart/HelloCart.csproj index 6379dd5ae..cb6571f21 100644 --- a/samples/HelloCart/HelloCart.csproj +++ b/samples/HelloCart/HelloCart.csproj @@ -1,9 +1,10 @@ + Exe - net7.0 + net8.0 enable - latest + preview Samples.HelloCart Samples.HelloCart @@ -21,4 +22,8 @@ + + <_ContentIncludedByDefault Remove="obj\project.packagespec.json" /> + + diff --git a/samples/MultiServerRpcApp/MultiServerRpcApp.csproj b/samples/MiniRpc/MiniRpc.csproj similarity index 71% rename from samples/MultiServerRpcApp/MultiServerRpcApp.csproj rename to samples/MiniRpc/MiniRpc.csproj index dc2d34dcb..8b8bed1fe 100644 --- a/samples/MultiServerRpcApp/MultiServerRpcApp.csproj +++ b/samples/MiniRpc/MiniRpc.csproj @@ -1,11 +1,12 @@ + Exe - net7.0 + net8.0 enable - latest - Samples.MultiServerRpcApp - Samples.MultiServerRpcApp + preview + Samples.MiniRpc + Samples.MiniRpc @@ -18,4 +19,5 @@ + diff --git a/samples/MiniRpcApp/Program.cs b/samples/MiniRpc/Program.cs similarity index 98% rename from samples/MiniRpcApp/Program.cs rename to samples/MiniRpc/Program.cs index ee3e8137b..5d3936413 100644 --- a/samples/MiniRpcApp/Program.cs +++ b/samples/MiniRpc/Program.cs @@ -1,4 +1,4 @@ -using Samples.MiniRpcApp; +using Samples.MiniRpc; using Stl.CommandR; using Stl.Fusion; using Stl.Fusion.Server; diff --git a/samples/MiniRpcApp/Service.cs b/samples/MiniRpc/Service.cs similarity index 98% rename from samples/MiniRpcApp/Service.cs rename to samples/MiniRpc/Service.cs index c66605eb7..b3d2c1240 100644 --- a/samples/MiniRpcApp/Service.cs +++ b/samples/MiniRpc/Service.cs @@ -5,7 +5,7 @@ using Stl.CommandR.Configuration; using Stl.Fusion; -namespace Samples.MiniRpcApp; +namespace Samples.MiniRpc; public interface IChat : IComputeService { diff --git a/samples/MiniRpcApp/MiniRpcApp.csproj b/samples/MultiServerRpc/MultiServerRpc.csproj similarity index 78% rename from samples/MiniRpcApp/MiniRpcApp.csproj rename to samples/MultiServerRpc/MultiServerRpc.csproj index 838d59a72..2eba9b86a 100644 --- a/samples/MiniRpcApp/MiniRpcApp.csproj +++ b/samples/MultiServerRpc/MultiServerRpc.csproj @@ -1,11 +1,12 @@ + Exe net7.0 enable - latest - Samples.MiniRpcApp - Samples.MiniRpcApp + preview + Samples.MultiServerRpc + Samples.MultiServerRpc @@ -18,4 +19,5 @@ + diff --git a/samples/MultiServerRpcApp/Program.cs b/samples/MultiServerRpc/Program.cs similarity index 99% rename from samples/MultiServerRpcApp/Program.cs rename to samples/MultiServerRpc/Program.cs index 31a0b621e..d72019eee 100644 --- a/samples/MultiServerRpcApp/Program.cs +++ b/samples/MultiServerRpc/Program.cs @@ -1,5 +1,5 @@ using Microsoft.Toolkit.HighPerformance; -using Samples.MultiServerRpcApp; +using Samples.MultiServerRpc; using Stl.CommandR; using Stl.Fusion; using Stl.Fusion.Server; diff --git a/samples/MultiServerRpcApp/Service.cs b/samples/MultiServerRpc/Service.cs similarity index 98% rename from samples/MultiServerRpcApp/Service.cs rename to samples/MultiServerRpc/Service.cs index 6ed8193d0..b38d224a0 100644 --- a/samples/MultiServerRpcApp/Service.cs +++ b/samples/MultiServerRpc/Service.cs @@ -7,7 +7,7 @@ using Stl.Text; using static System.Console; -namespace Samples.MultiServerRpcApp; +namespace Samples.MultiServerRpc; public record ServerId(Symbol Id); // Used just to display the message with Server ID diff --git a/src/Stl.CommandR/Stl.CommandR.csproj b/src/Stl.CommandR/Stl.CommandR.csproj index 9a428bf46..a0a378d93 100644 --- a/src/Stl.CommandR/Stl.CommandR.csproj +++ b/src/Stl.CommandR/Stl.CommandR.csproj @@ -1,7 +1,7 @@ - net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 servicetitan stl stl_fusion commandr Stl.CommandR - a MediatR-like library created to simplify CQRS implementations even further.Fusion services utilizing EF Core and Npgsql (PostgreSQL EF Core provider). @@ -10,6 +10,10 @@ + + + + diff --git a/src/Stl.Fusion.EntityFramework.Redis/Stl.Fusion.EntityFramework.Redis.csproj b/src/Stl.Fusion.EntityFramework.Redis/Stl.Fusion.EntityFramework.Redis.csproj index f9cb84bbe..c7caf4335 100644 --- a/src/Stl.Fusion.EntityFramework.Redis/Stl.Fusion.EntityFramework.Redis.csproj +++ b/src/Stl.Fusion.EntityFramework.Redis/Stl.Fusion.EntityFramework.Redis.csproj @@ -1,7 +1,7 @@ - net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 servicetitan stl stl_fusion Stl.Fusion.EntityFramework.Redis - Fusion services utilizing EF Core and Redis. diff --git a/src/Stl.Fusion.EntityFramework/Stl.Fusion.EntityFramework.csproj b/src/Stl.Fusion.EntityFramework/Stl.Fusion.EntityFramework.csproj index 85b2e97e3..299c70524 100644 --- a/src/Stl.Fusion.EntityFramework/Stl.Fusion.EntityFramework.csproj +++ b/src/Stl.Fusion.EntityFramework/Stl.Fusion.EntityFramework.csproj @@ -1,17 +1,20 @@ - net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 servicetitan stl stl_fusion Stl.Fusion.EntityFramework - Fusion services utilizing EF Core. - - - + + + + + + diff --git a/src/Stl.Fusion.Ext.Contracts/Stl.Fusion.Ext.Contracts.csproj b/src/Stl.Fusion.Ext.Contracts/Stl.Fusion.Ext.Contracts.csproj index d78890ac1..0f982786a 100644 --- a/src/Stl.Fusion.Ext.Contracts/Stl.Fusion.Ext.Contracts.csproj +++ b/src/Stl.Fusion.Ext.Contracts/Stl.Fusion.Ext.Contracts.csproj @@ -1,7 +1,7 @@ - net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0 servicetitan stl stl_fusion client Client-side components of Stl.Fusion - a new implementation of "computed observables" a new implementation of "computed observables" a new implementation of "computed observables" a new implementation of "computed observables" related to method call interception.MEF-style plugin library that focuses on core capabilities relatively small abstractions or methods we couldn't find in BCL. true diff --git a/tests/Stl.Fusion.Tests.PerformanceTestRunner/Stl.Fusion.Tests.PerformanceTestRunner.csproj b/tests/Stl.Fusion.Tests.PerformanceTestRunner/Stl.Fusion.Tests.PerformanceTestRunner.csproj index 93b003463..2192c59c3 100644 --- a/tests/Stl.Fusion.Tests.PerformanceTestRunner/Stl.Fusion.Tests.PerformanceTestRunner.csproj +++ b/tests/Stl.Fusion.Tests.PerformanceTestRunner/Stl.Fusion.Tests.PerformanceTestRunner.csproj @@ -2,7 +2,7 @@ Exe - net7.0;net6.0;net5.0;netcoreapp3.1 + net8.0;net7.0;net6.0;net5.0;netcoreapp3.1 true diff --git a/tests/Stl.Fusion.Tests/Authentication/AuthServiceTest.cs b/tests/Stl.Fusion.Tests/Authentication/AuthServiceTest.cs index b25b25566..3c1a97e6f 100644 --- a/tests/Stl.Fusion.Tests/Authentication/AuthServiceTest.cs +++ b/tests/Stl.Fusion.Tests/Authentication/AuthServiceTest.cs @@ -316,17 +316,6 @@ public async Task EditTest() user = await auth.GetUser(session); user.Should().NotBeNull(); user!.Name.Should().Be("John"); - -#if NET5_0_OR_GREATER - if (DbType != FusionTestDbType.InMemory && DbType != FusionTestDbType.MariaDb) { - await Assert.ThrowsAnyAsync(async () => { - await commander.Call(new Auth_EditUser(session, "Jo")); - }); - } -#endif - user = await auth.GetUser(session); - user.Should().NotBeNull(); - user!.Name.Should().Be("John"); } [Fact] diff --git a/tests/Stl.Fusion.Tests/FusionTestBase.cs b/tests/Stl.Fusion.Tests/FusionTestBase.cs index b56a4199a..20fa47780 100644 --- a/tests/Stl.Fusion.Tests/FusionTestBase.cs +++ b/tests/Stl.Fusion.Tests/FusionTestBase.cs @@ -182,10 +182,6 @@ protected override void ConfigureServices(IServiceCollection services, bool isCl default: throw new NotSupportedException(); } -#if NET5_0_OR_GREATER - if (DbType != FusionTestDbType.InMemory) - builder.UseValidationCheckConstraints(c => c.UseRegex(false)); -#endif builder.EnableSensitiveDataLogging(); }, 256); services.AddDbContextServices(db => { diff --git a/tests/Stl.Fusion.Tests/Server/ExceptionContextFixture.cs b/tests/Stl.Fusion.Tests/Server/ExceptionContextFixture.cs index 38fc8ad11..d15eccc1e 100644 --- a/tests/Stl.Fusion.Tests/Server/ExceptionContextFixture.cs +++ b/tests/Stl.Fusion.Tests/Server/ExceptionContextFixture.cs @@ -1,4 +1,5 @@ #if NETFRAMEWORK +using System.Net.Http; using System.Web.Http.Filters; using System.Web.Http.Controllers; using System.Web.Http; @@ -40,7 +41,7 @@ public ExceptionContextFixture() Fixture.Register(() => _serviceProviderMock); #if NETFRAMEWORK - Fixture.Customize(x => + Fixture.Customize(x => x.Without(x => x.Response)); Fixture.Register(() => new HttpActionContext { diff --git a/tests/Stl.Fusion.Tests/Stl.Fusion.Tests.csproj b/tests/Stl.Fusion.Tests/Stl.Fusion.Tests.csproj index 96a77784a..7500db32c 100644 --- a/tests/Stl.Fusion.Tests/Stl.Fusion.Tests.csproj +++ b/tests/Stl.Fusion.Tests/Stl.Fusion.Tests.csproj @@ -12,22 +12,30 @@ - - - - - - - + + + + + + + + + + + + + + - @@ -36,7 +44,6 @@ - @@ -45,7 +52,6 @@ - diff --git a/tests/Stl.Tests/Stl.Tests.csproj b/tests/Stl.Tests/Stl.Tests.csproj index 3761d0aff..300287215 100644 --- a/tests/Stl.Tests/Stl.Tests.csproj +++ b/tests/Stl.Tests/Stl.Tests.csproj @@ -7,15 +7,20 @@ + + + + - - - - + + + + +