我有三个文件appsettings.json,这是我要存储通用共享设置"的文件,然后有appsettings.Development.json和appsettings.Production.json.
当我从Visual Studio中进行发布时,似乎只复制了appsettings.json而不是添加/合并或什至只是发送部署文件夹的简单副本,对我来说,此任务应该合并到部署管道中./p>
问题是:我该怎么办?我想念什么?难道不应该将这些动作纳入流程吗?
解决方案请确保您的project.json具有要发布和/或复制到输出的文件列表中包含的那些文件:
"buildOptions": { "copyToOutput": [ ... "appsettings.json", "appsettings.*.json", ... ], }或
"publishOptions": { "include": [ ... "appsettings.json", "appsettings.*.json", ... ] }文件不会合并到单个文件中.它们将在运行时由配置系统进行逻辑合并.
I have three files appsettings.json which is a file that I want to store "general shared settings", then I have appsettings.Development.json and appsettings.Production.json.
When I do a publish from Visual Studio, it seems like only appsettings.json is copied and not adding / merge or even just send a simple copy the deployment folder, to me this task should be incorporated into the deployment pipeline.
The question is: how can I do it? What am I missing? Is it not supposed that these actions should be already be incorporated in the process?
解决方案Make sure your project.json has those files included in the list of files to publish and/or copy to output:
"buildOptions": { "copyToOutput": [ ... "appsettings.json", "appsettings.*.json", ... ], }or
"publishOptions": { "include": [ ... "appsettings.json", "appsettings.*.json", ... ] }The files will not be merged in a single file. They will be logically merged at runtime by the configuration system.
更多推荐
将appsettings.json发布到不同的环境
发布评论