I setup a IIS application from within an existing application.
我从现有的应用程序中设置了IIS应用程序。
Will the parents web.config be inherited or is that something I have to set explicitly?
父母web.config是继承还是我必须明确设置的东西?
4 个解决方案
#1
6
Yes it will without setting anything explicitly, and I don't know any way to prevent it.
是的,它没有明确地设置任何东西,我不知道有什么方法可以阻止它。
However many configuration sections will allow you to clear data inherited from parent files.
但是,许多配置部分将允许您清除从父文件继承的数据。
E.g.
例如。
<appSettings>
<clear/>
<add key=...>
</appSettings>
<connectionStrings>
<clear/>
<add ... />
</connectionStrings>
#2
4
You can also use the remove
tag to get rid of things you don't want or put everything in a location and tell it not to inherit:
您还可以使用remove标记来删除您不想要的内容,或者将所有内容放在某个位置并告诉它不要继承:
<remove name="FooBar" />
<location path="." inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>
#3
1
The child inherits the parent's web.config file.
子进程继承父进程的web.config文件。
Also, when a new web.config
file is created in the child, the child's web.config
file settings override the same settings in the parent's web.config
file.
此外,当在子级中创建新的web.config文件时,子级的web.config文件设置将覆盖父级web.config文件中的相同设置。
#4
0
What you do is change the parent .NET 4 app's web.config to indicate its settings shouldn't flow down to the children
您所做的是更改父.NET 4应用程序的web.config,以指示其设置不应向下传递给子项
<location path="." inheritInChildApplications="false">
<system.web>
...your system.web stuff goes here
</system.web>
</location>
For more details refer here http://www.hanselman.com/blog/ChangingASPNETWebconfigInheritanceWhenMixingVersionsOfChildApplications.aspx
有关详细信息,请参阅http://www.hanselman.com/blog/ChangingASPNETWebconfigInheritanceWhenMixingVersionsOfChildApplications.aspx
#1
6
Yes it will without setting anything explicitly, and I don't know any way to prevent it.
是的,它没有明确地设置任何东西,我不知道有什么方法可以阻止它。
However many configuration sections will allow you to clear data inherited from parent files.
但是,许多配置部分将允许您清除从父文件继承的数据。
E.g.
例如。
<appSettings>
<clear/>
<add key=...>
</appSettings>
<connectionStrings>
<clear/>
<add ... />
</connectionStrings>
#2
4
You can also use the remove
tag to get rid of things you don't want or put everything in a location and tell it not to inherit:
您还可以使用remove标记来删除您不想要的内容,或者将所有内容放在某个位置并告诉它不要继承:
<remove name="FooBar" />
<location path="." inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>
#3
1
The child inherits the parent's web.config file.
子进程继承父进程的web.config文件。
Also, when a new web.config
file is created in the child, the child's web.config
file settings override the same settings in the parent's web.config
file.
此外,当在子级中创建新的web.config文件时,子级的web.config文件设置将覆盖父级web.config文件中的相同设置。
#4
0
What you do is change the parent .NET 4 app's web.config to indicate its settings shouldn't flow down to the children
您所做的是更改父.NET 4应用程序的web.config,以指示其设置不应向下传递给子项
<location path="." inheritInChildApplications="false">
<system.web>
...your system.web stuff goes here
</system.web>
</location>
For more details refer here http://www.hanselman.com/blog/ChangingASPNETWebconfigInheritanceWhenMixingVersionsOfChildApplications.aspx
有关详细信息,请参阅http://www.hanselman.com/blog/ChangingASPNETWebconfigInheritanceWhenMixingVersionsOfChildApplications.aspx