asp.net - 覆盖 ASP.NET 子应用程序中的 web.config

标签 asp.net iis web-config

IIS 7 .NET 4.0 我有一个包含 4 个子 Web 应用程序的网站。 其中 3 个需要来自parent-web.config 的设置 应该有一个完全独立的web.config(无继承) 我知道可以关闭子应用程序的继承。 但我需要的是一种只为一个子应用程序关闭它的方法! (无需单独每个部分.. 所以我正在我的子 web.config 中寻找类似“dontInheritParentConfig”设置的内容

谢谢!

最佳答案

在.net 4中您可以使用Web.config Transformation Syntax for Web Application Project Deployment 。这是对 web.config 的模板更改,以允许文件在不同场景中有所不同 - 这应该适合您的子应用程序需求。

Web.config files typically include settings that have to be different depending on which environment the application is running in. For example, you might have to change a database connection string or disable debugging when you deploy a Web.config file. For Web application projects, ASP.NET provides tools that automate the process of changing (transforming) Web.config files when they are deployed. For each environment that you want to deploy to, you create a transform file that specifies only the differences between the original Web.config file and the deployed Web.config file for that environment.

关于asp.net - 覆盖 ASP.NET 子应用程序中的 web.config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6281859/

相关文章:

windows - 当您已经安装了 IIS/SQL Server 时,在 Windows 上针对 WordPress 进行开发的最佳方法是什么?

wcf - 我可以将连接字符串与 WCF 中的终结点相关联吗?

xml - Azure 上的 Elmah XML 日志文件

c# - 在不重复包含指令的情况下向 ASP.NET Web 控件 (ascx) 添加样式和脚本

c# - 升级到 SignalR 1.0.0 alpha2 时未触发 OnConnected 任务

azure - 在 IIS 当前用户/个人存储中安装证书

c# - 使用C#的电子邮件发送问题

javascript - ext.net Javascript 在事件发生前点击的多个函数

javascript - 从 javascript 调用隐藏代码

wcf - 使用 Windows 身份验证在 IIS 中托管 WCF 服务,无需匿名访问