[英]Create multiple Razor Class Library (RCL) for the same application and include conditionally only one of them per deployment
I'm working on a web shop application written in ASP MVC Core .NET 6 designed to be deployed multiple times - once per country.我正在开发一个用 ASP MVC Core 编写的 web 商店应用程序 .NET 6 旨在多次部署 - 每个国家/地区一次。 All deployments will be similar to itself (all are meant for the same client) with small differences in layout and features.所有部署都将与其自身相似(所有部署均针对同一客户端),布局和功能略有不同。 Each instance will have it's own database.每个实例都有自己的数据库。 Configuration of each instance is stored in database, so in my application there is only connection string that differs between instances.每个实例的配置都存储在数据库中,因此在我的应用程序中只有实例之间的连接字符串不同。
As I have written it, I have single webshop engine written as a class library, one single MVC application (containing all controllers, middlewares etc.) targeting that class library and a set of many different Razor Class Libraries (RCL) containing specific layouts for each country instance.正如我所写的,我有一个写成 class 库的单一网上商店引擎,一个针对 class 库的单个 MVC 应用程序(包含所有控制器、中间件等)和一组许多不同的 Razor Class 库(RCL),其中包含特定布局每个国家实例。 Each RCL is also targeting the webshop class library (I have RCL.EN lib for english webshop instance, RCL.DE lib for german instance and 40 countries more).每个 RCL 还针对网上商店 class 库(我有用于英语网上商店实例的 RCL.EN 库,用于德语实例的 RCL.DE 库以及更多 40 个国家/地区)。
Now the problem I'm facing is that I have all that in a single solution with one app, one engine class library and many frontend RCL libs.现在我面临的问题是我在一个单一的解决方案中拥有所有这些,包括一个应用程序、一个引擎 class 库和许多前端 RCL 库。 During deployment with VS2022 I'm deploying all fontend RCL libraries at once, while I need a way to conditionally include only one Lib per deployment.在使用 VS2022 进行部署期间,我一次部署所有 fontend RCL 库,而我需要一种方法来有条件地在每次部署中仅包含一个 Lib。
I can exclude manually unused languaged before deployment so only one is deploying, but having 40+ countries require lots of unnecesserily work.我可以在部署之前手动排除未使用的语言,因此只有一个正在部署,但拥有 40 多个国家/地区需要大量不必要的工作。
Can I create environment configs for 40 countries with 40 sets of deployments?我可以为 40 个国家/地区创建 40 组部署的环境配置吗? Or maybe use gitlab pipelines for that?或者为此使用 gitlab 管道?
I have found out that I can use VS Configuration Manager to create multiple build configurations - one per language.我发现我可以使用 VS 配置管理器来创建多个构建配置——每种语言一个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.