From 5a725cf96ac0f755d01eea1002b78fd821674a6d Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Tue, 6 Jan 2026 12:30:43 +0300 Subject: [PATCH 1/4] Fix IOE Synchronous operations are disallowed --- .../Startup.cs | 31 +++++----- src/OrchardCoreContrib.Modules.Web/Startup.cs | 59 +++++++++---------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs b/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs index a8ad6465..ff1828b1 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs +++ b/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs @@ -3,26 +3,23 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using OrchardCore.Modules; -using System; -namespace OrchardCoreContrib.Diagnostics.Elm +namespace OrchardCoreContrib.Diagnostics.Elm; + +/// +/// Represensts a startup point to register the required services by Elm diagnostics module. +/// +public class Startup : StartupBase { - /// - /// Represensts a startup point to register the required services by Elm diagnostics module. - /// - public class Startup : StartupBase + /// + public override void ConfigureServices(IServiceCollection services) { - /// - public override void ConfigureServices(IServiceCollection services) - { - services.AddElm(options => options.Path = new PathString("/elm")); - } + services.AddElm(options => options.Path = new PathString("/elm")); + } - /// - public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) - { - builder.UseElmCapture(); - builder.UseElmPage(); - } + /// + public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) + { + builder.UseElmPage(); } } diff --git a/src/OrchardCoreContrib.Modules.Web/Startup.cs b/src/OrchardCoreContrib.Modules.Web/Startup.cs index b0cee2de..7e2ccba3 100644 --- a/src/OrchardCoreContrib.Modules.Web/Startup.cs +++ b/src/OrchardCoreContrib.Modules.Web/Startup.cs @@ -1,41 +1,40 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using OrchardCore.Environment.Shell; +using Microsoft.AspNetCore.Server.Kestrel.Core; using OrchardCoreContrib.Users.Services; -namespace OrchardCoreContrib.Modules.Web +namespace OrchardCoreContrib.Modules.Web; + +public class Startup { - public class Startup + public void ConfigureServices(IServiceCollection services) { - public void ConfigureServices(IServiceCollection services) - { - services - .AddOrchardCms(builder => - { - builder.AddSetupFeatures("OrchardCore.AutoSetup", "OrchardCoreContrib.Tenants"); - //builder.ConfigureServices(builderServices => - //{ - // builderServices.AddYesSqlDataMigrations(); + // Fix IOE Synchronous operations are disallowed + services.Configure(options => options.AllowSynchronousIO = true); + services.Configure(options => options.AllowSynchronousIO = true); - // builderServices.AddScoped(); - // builderServices.AddScoped(sp => sp.GetRequiredService()); - //}); - }); + services + .AddOrchardCms(builder => + { + builder.AddSetupFeatures("OrchardCore.AutoSetup", "OrchardCoreContrib.Tenants"); + //builder.ConfigureServices(builderServices => + //{ + // builderServices.AddYesSqlDataMigrations(); - // Workaround to avoid IOE on UserMenu shape - services.AddScoped(); - } + // builderServices.AddScoped(); + // builderServices.AddScoped(sp => sp.GetRequiredService()); + //}); + }); - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } + // Workaround to avoid IOE on UserMenu shape + services.AddScoped(); + } - app.UseOrchardCore(); + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); } + + app.UseOrchardCore(); } } From 05b4bff44ed683b6515062f6c1576bac22336ece Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Tue, 6 Jan 2026 12:36:15 +0300 Subject: [PATCH 2/4] Configure ElmOptions from appsettings.json --- src/OrchardCoreContrib.Diagnostics.Elm/Constants.cs | 6 ++++++ src/OrchardCoreContrib.Diagnostics.Elm/README.md | 2 +- src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs | 9 ++++++--- src/OrchardCoreContrib.Modules.Web/appsettings.json | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/OrchardCoreContrib.Diagnostics.Elm/Constants.cs diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/Constants.cs b/src/OrchardCoreContrib.Diagnostics.Elm/Constants.cs new file mode 100644 index 00000000..eb175341 --- /dev/null +++ b/src/OrchardCoreContrib.Diagnostics.Elm/Constants.cs @@ -0,0 +1,6 @@ +namespace OrchardCoreContrib.Diagnostics.Elm; + +public class Constants +{ + public const string ConfigurationKey = "OrchardCoreContrib_Diagnostics_Elm"; +} diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/README.md b/src/OrchardCoreContrib.Diagnostics.Elm/README.md index aa532c49..602ffd02 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/README.md +++ b/src/OrchardCoreContrib.Diagnostics.Elm/README.md @@ -41,4 +41,4 @@ This module has no dependencies. 3. Select **Configuration -> Features** menu. 4. Enable the `Elm Diagnostics` feature. 5. Go to the site. -6. Visit the ELm end-point by append `/elm` to the URL. +6. Visit the ELm end-point by append `/elm` to the URL. In case you need to change the path, set the `Path` property of the `OrchardCoreContrib_Diagnostics_Elm` settings section from within `appsettings.json`. diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs b/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs index ff1828b1..5a5428c3 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs +++ b/src/OrchardCoreContrib.Diagnostics.Elm/Startup.cs @@ -1,7 +1,8 @@ using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Diagnostics.Elm; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; +using OrchardCore.Environment.Shell.Configuration; using OrchardCore.Modules; namespace OrchardCoreContrib.Diagnostics.Elm; @@ -9,12 +10,14 @@ namespace OrchardCoreContrib.Diagnostics.Elm; /// /// Represensts a startup point to register the required services by Elm diagnostics module. /// -public class Startup : StartupBase +public class Startup(IShellConfiguration shellConfiguration) : StartupBase { /// public override void ConfigureServices(IServiceCollection services) { - services.AddElm(options => options.Path = new PathString("/elm")); + services.Configure(shellConfiguration.GetSection(Constants.ConfigurationKey)); + + services.AddElm(); } /// diff --git a/src/OrchardCoreContrib.Modules.Web/appsettings.json b/src/OrchardCoreContrib.Modules.Web/appsettings.json index 0230a6cf..f42cc747 100644 --- a/src/OrchardCoreContrib.Modules.Web/appsettings.json +++ b/src/OrchardCoreContrib.Modules.Web/appsettings.json @@ -39,6 +39,9 @@ } ] }, + //"OrchardCoreContrib_Diagnostics_Elm": { + // "Path": "/elm" + //}, //"OrchardCoreContrib_HealthChecks": { // "Url": "/health", // "ShowDetails": true From 07c0b862a9462ee5faba304e42988580e2d6f4ac Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Tue, 6 Jan 2026 12:36:49 +0300 Subject: [PATCH 3/4] Bump OCC.Diagnostics.Elm to 1.6.0 --- src/OrchardCoreContrib.Diagnostics.Elm/Manifest.cs | 4 ++-- .../OrchardCoreContrib.Diagnostics.Elm.csproj | 2 +- src/OrchardCoreContrib.Diagnostics.Elm/README.md | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/Manifest.cs b/src/OrchardCoreContrib.Diagnostics.Elm/Manifest.cs index 48fadefa..41744de7 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/Manifest.cs +++ b/src/OrchardCoreContrib.Diagnostics.Elm/Manifest.cs @@ -5,7 +5,7 @@ Name = "Elm Diagnostics", Author = ManifestConstants.Author, Website = ManifestConstants.Website, - Version = "1.4.1", - Description = "Provides services to handle errors using Elm.", + Version = "1.6.0", + Description = "Provides services to handle errors using ASP.NET Core Error Logging Middleware (ELM).", Category = "Infrastructure" )] diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj b/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj index 23151ae8..b96b960e 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj +++ b/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj @@ -1,7 +1,7 @@  - 1.5.0 + 1.6.0 The Orchard Core Contrib Team Provides services to handle errors using Elm. diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/README.md b/src/OrchardCoreContrib.Diagnostics.Elm/README.md index 602ffd02..1e76659d 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/README.md +++ b/src/OrchardCoreContrib.Diagnostics.Elm/README.md @@ -1,10 +1,10 @@ # Elm Diagnostics Module -This module handle and logs errors using Elm. +This module handle and logs errors using ASP.NET Core Error Logging Middleware (ELM). ## Version -1.4.1 +1.6.0 ## Category @@ -26,6 +26,7 @@ This module has no dependencies. | Name | Version | |-----------------------------------------------------------------------------------------------------------------|---------| +| [`OrchardCoreContrib.Diagnostics.Elm`](https://www.nuget.org/packages/OrchardCoreContrib.Diagnostics.Elm/1.6.0) | 1.6.0 | | [`OrchardCoreContrib.Diagnostics.Elm`](https://www.nuget.org/packages/OrchardCoreContrib.Diagnostics.Elm/1.5.0) | 1.5.0 | | [`OrchardCoreContrib.Diagnostics.Elm`](https://www.nuget.org/packages/OrchardCoreContrib.Diagnostics.Elm/1.4.1) | 1.4.1 | | [`OrchardCoreContrib.Diagnostics.Elm`](https://www.nuget.org/packages/OrchardCoreContrib.Diagnostics.Elm/1.4.0) | 1.4.0 | From ed3768d382bdd610ecc445df53da8b1e0905c0f5 Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Tue, 6 Jan 2026 12:41:12 +0300 Subject: [PATCH 4/4] Add README.md to NuGet package --- .../OrchardCoreContrib.Diagnostics.Elm.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj b/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj index b96b960e..1215f608 100644 --- a/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj +++ b/src/OrchardCoreContrib.Diagnostics.Elm/OrchardCoreContrib.Diagnostics.Elm.csproj @@ -5,6 +5,7 @@ The Orchard Core Contrib Team Provides services to handle errors using Elm. + README.md BSD-3-Clause https://github.com/OrchardCoreContrib/OrchardCoreContrib.Modules/tree/main/src/OrchardCoreContrib.Diagnostics.Elm/README.md https://github.com/OrchardCoreContrib/OrchardCoreContrib.Modules @@ -21,6 +22,7 @@ +