如何合并分发web.config文件和现有的web.config? [英] How to merge a distribution web.config file and an existing web.config ?

查看:77
本文介绍了如何合并分发web.config文件和现有的web.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在准备部署ASP.NET Web应用程序.
目标服务器已经具有我的Web应用程序的早期版本,并且在web.config文件中指定了参数.

在此Web应用程序的新版本中,web.config文件包含新的部分,我希望它们显示在服务器上的目标web.config中.
但是我找不到将新的web.config部分合并到现有的web.config文件中的方法吗? :((

我是否必须通过编程方式执行此操作,或者是否有工具在安装过程中合并两个文件? (我正在使用Web设置项目).

非常感谢您的回答:thumbsup:

Hello,

I''m preparing to deploy a ASP.NET web application.
The target server has already a previous version of my web application with parameters specified on the web.config file.

In the new version of this web application, the web.config file contains new sections I would like they appear on the target web.config on the server.

However I can''t find the way to merge the new web.config sections into the existing web.config file ? :((

Does I have to do that programmatically, or is there a tool to merge the both files during installation ? (I''m using Web Setup Project).

Thanks a lot for your answer :thumbsup:

推荐答案

也许我完全误解了您,在这种情况下,请忽略我,但您不能仅复制所需的部分到新的Web.config中,然后部署操作将实质上将新的Web.config复制到旧的Web.config中?
Perhaps I''ve completely misunderstood you in which case ignore me but couldn''t you just copy the required sections into the new Web.config and then the deploy action will, essentially, copy the new Web.config over the old?


Web.Config文件是物理可用的文件...您可以找到它.就像您说的那样,第二个配置文件是较新的版本,这意味着所有配置设置都必须相同..仅添加了几个新的键".

拉出旧的,将新的密钥添加到新的.更换!

如果其他任何配置也丢失/更改,请添加/修改/更正.无需任何编程方式....如果您不知道,则Web应用程序可以具有onley ONE Web.config文件.
:thumbsup:
Web.Config file is a physically available file... you can locate it. As you say, 2nd config file is a newer version, this means all the configuration setting must be same.. just few new ''keys'' added.

Pullout the old one, add the new keys to the new one. Replace it!

In case, if any other configuration is also missing/changed... add/modify/rectify it. No need for any programmtic way.... if you are not aware, web application can have onley ONE Web.config file.
:thumbsup:


由于web.config是Web应用程序的核心,因此我建议在服务器中手动对其进行修改.

另外,它在服务器中可用.因此,新的更改将减少,并且您知道这些更改.更好的是手动修改它.如果确定有最新版本,并且服务器中没有任何更改,则只需覆盖它即可.

尽管市场上有各种工具可用,并且您可以通过网络搜索得到这些工具,但是我还是建议您手动对其进行修改,因为它是服务器的核心.如果出了什么问题,除了手动部署外,还需要您付出更多的努力.
As web.config is the heart of web application, I will recommend to manually modifying it in the server.

Also, it is available in the server. So, the new changes will be less and you know those changes. Better is to modify it manually. If you are sure that, you have the latest one & nothing has been changed in the server, then just overwrite it.

Though there are various tools available in the market & you will get those if you search over net, again i will recommend you to manually modifying it as it is the heart of the server. If anything goes wrong, it will take most of your efforts than manual deploy.


这篇关于如何合并分发web.config文件和现有的web.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆