简体   繁体   English

为同一个应用程序创建多个 Razor Class 库 (RCL) 并有条件地在每个部署中只包含其中一个

[英]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.

相关问题 对同一个类库的多个引用 - Multiple references to the same class library 如何在西装外套应用程序的项目中引用 razor class 库? - how to refer razor class library in project in blazer application? Razor 类库中的图像 - Images in Razor Class Library 每个文件仅执行一个类 - Enforce only one class per file 使用双泛型的C#类:当两个泛型相同时,仅给出一个? - C# Class using double Generics: give only one when both of them should be the same? 如何有条件/动态地在 Asp.Net Core Razor 页面中包含 Razor 子页面? - How do I conditionally/dynamically include Razor subpages in an Asp.Net Core Razor page? C#.Net-如何仅创建类的一个对象并在整个项目中使用该对象 - C#.Net - How can i create only one object of the class and use the same through out the project 如何创建包含具有相同输出程序集名称的应用程序和类库项目的C#解决方案? - How can I create a C# solution that contains an application and class library project that have the same output assembly name? 我应该为每个Paint请求创建新的Pens / Brushes还是在整个应用程序生命周期中保留它们? - Should I create new Pens/Brushes per Paint request or keep them throughout the application lifecycle? 如何在同一安装部署中包含安装文件? - How to include setup file in the same Setup Deployment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM