From ba9fc291117a52c7b653c16d3a8a29e6e92c4bf8 Mon Sep 17 00:00:00 2001 From: KrzysztofPajak Date: Sun, 9 Aug 2026 22:08:47 +0200 Subject: [PATCH] Move the business layer implementations to the hosts Grand.Web.Common referenced all nine Grand.Business.* implementations alongside the contracts in Grand.Business.Core, without using a single type from any of them. Because Grand.Web is built on Grand.Web.Common, and Grand.Plugin.props points every plugin at it too, the shared web layer and each plugin compiled against the whole business layer for no reason. The references were never about code. Each implementation carries a Startup/StartupApplication.cs, and TypeSearcher discovers IStartupApplication by walking the assemblies present in the AppDomain - so an implementation the host does not reference is never registered. That makes the host, as the composition root, the place they belong. src/Build/Grand.Host.props holds the list once, the way Grand.Plugin.props already does for plugins, and says why removing an entry costs an entire area's DI registration with nothing failing at build time. Each host's dependency closure is unchanged: the same nine assemblies are still referenced, copied and written to deps.json. Only the compile-time graph of Grand.Web.Common shrinks, from twelve project references to three. One consequence was not obvious. Those references were also an implicit version floor for Grand.Web.AdminShared: the Scryber.Core graph outvoted elFinder.Net.* 1.5.0, and without them elFinder won with Newtonsoft.Json 11.0.2 (GHSA-5crp-9r3c-p9vr) and SixLabors.ImageSharp 2.0.0 (GHSA-2cmq-823j-5qj8 and six more). The floor is now stated explicitly next to the existing Microsoft.AspNetCore.Http pin, which exists for the same package graph and the same reason, and resolves back to the 13.0.3 and 3.1.12 that the accident used to produce. Co-Authored-By: Claude Opus 5 --- Directory.Packages.props | 2 + src/Build/Grand.Host.props | 41 +++++++++++++++++++ .../Grand.Web.Admin/Grand.Web.Admin.csproj | 1 + .../Grand.Web.AdminShared.csproj | 11 +++++ .../Grand.Web.Common/Grand.Web.Common.csproj | 13 ------ .../Grand.Web.Store/Grand.Web.Store.csproj | 1 + .../Grand.Web.Vendor/Grand.Web.Vendor.csproj | 1 + src/Web/Grand.Web/Grand.Web.csproj | 1 + 8 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 src/Build/Grand.Host.props diff --git a/Directory.Packages.props b/Directory.Packages.props index 6fdf625a4..7159cbd14 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,6 +7,8 @@ + + diff --git a/src/Build/Grand.Host.props b/src/Build/Grand.Host.props new file mode 100644 index 000000000..372c61877 --- /dev/null +++ b/src/Build/Grand.Host.props @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj b/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj index 618afe4d5..8bf8d66b7 100644 --- a/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj +++ b/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj @@ -1,5 +1,6 @@  + true true diff --git a/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj b/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj index 8f965a46f..3543d02a4 100644 --- a/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj +++ b/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj @@ -17,5 +17,16 @@ Microsoft.AspNetCore.Http 2.1.1 has a known high severity advisory (GHSA-hxrm-9w7p-39cc). This reference lifts it to a patched 2.x. Remove only together with elFinder. --> + + + diff --git a/src/Web/Grand.Web.Common/Grand.Web.Common.csproj b/src/Web/Grand.Web.Common/Grand.Web.Common.csproj index 607719f89..e021874b4 100644 --- a/src/Web/Grand.Web.Common/Grand.Web.Common.csproj +++ b/src/Web/Grand.Web.Common/Grand.Web.Common.csproj @@ -17,18 +17,5 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Web/Grand.Web.Store/Grand.Web.Store.csproj b/src/Web/Grand.Web.Store/Grand.Web.Store.csproj index 3031821f6..ad0a7be75 100644 --- a/src/Web/Grand.Web.Store/Grand.Web.Store.csproj +++ b/src/Web/Grand.Web.Store/Grand.Web.Store.csproj @@ -1,6 +1,7 @@  + true true diff --git a/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj b/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj index 0e082d854..5ba2f8eab 100644 --- a/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj +++ b/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj @@ -1,5 +1,6 @@  + true false diff --git a/src/Web/Grand.Web/Grand.Web.csproj b/src/Web/Grand.Web/Grand.Web.csproj index f0c2420e1..394818e8d 100644 --- a/src/Web/Grand.Web/Grand.Web.csproj +++ b/src/Web/Grand.Web/Grand.Web.csproj @@ -1,5 +1,6 @@  +