web developer tips (42):用IIS配置编辑器生成脚本来更新配置

原文地址:ConfigurationEditor allows you to generate C#, JavaScript or AppCmd script to update configuration

如果你想写段脚本来添加或更新已经存在的配置,无论配置文件属于那种类型的,比如 administration.config, applicationHost.config 或 网站 或 应用程序的 web.config),你都可以安装配置编辑器(Configuration Editor)来实现,它是IIS管理包的一部分,使用"生成脚本"的功能,用来更新配置,真的是非常有用的功能。

有关IIS配置编辑器模块的安装和下载见:
http://www.watch-life.net/visual-studio/configurationeditor-update-configuration.html

32-bit 管理包 :http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1682

64-bit 管理包:http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1682

管理包安装完后,在iis里打开配置编辑器
ed1

首先,如果想修改配置,选中需要修改的配置文件,然后从下面的下拉配置选中,添加新的或修改现有的配置,然后单击“Generate Scrip”(生成脚本)

image

从弹出的窗口复制代码,并修改。生成的代码有三种:c#, JavaScript,AppCmd

image

关于如何使用配置编辑器的更多内容,可以参考下面的链接

1、Using Configuration Editor: Generate Scripts

2、How to Script / Automate IIS7 Configuration



微信扫描下方的二维码阅读本文

那年今日

2008-09-03 Google Chrome 会是IE的终结者么? (4 个评论)

2008-09-03 Google Chrome 初试手记 (2 个评论)

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注