加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net管理多个web.config文件

发布时间:2020-12-16 09:29:56 所属栏目:asp.Net 来源:网络整理
导读:任何人都可以建议一个管理多个web.config文件的好方法吗? 例如,我有一个开发web.config,我在我的localmachine上使用名为“localWeb.config”,然后我用于生产的名为“prodWeb.config”.我保留.config扩展名,因此没有人可以从Web服务器访问它们. 例如,localWe
任何人都可以建议一个管理多个web.config文件的好方法吗?

例如,我有一个开发web.config,我在我的localmachine上使用名为“localWeb.config”,然后我用于生产的名为“prodWeb.config”.我保留.config扩展名,因此没有人可以从Web服务器访问它们.

例如,localWeb.config将具有到开发数据库的连接字符串,而prodWeb.config有一个到生产数据库的连接字符串.

目前,我正在使用postbuild事件将localWeb.config或prodWeb.config的内容复制到web.config.这很好,但我想知道是否有人知道更好的方法.

解决方法

查看 Web Deployment Tool:

Here are just a few of the tasks that
be accomplished using the tool:

  1. Create a package that contains content,configuration and SQL
    databases for deployment or sharing
    with others.

  2. Use the package as a way to version your application or create backups.

  3. Add parameters to replace a connection string or other value in a
    file during install of a package.

  4. Enable non-administrators to deploy packages and granularly control their
    access.

  5. Synchronize or migrate both sites and servers running IIS 6.0 and IIS 7.0.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读