“Entry has already been added” - Two Separate App Pools

江枫思渺然 提交于 2019-11-28 11:23:21

Web.config inheritance happens even between different appPools. If you want to stop this behavior, you should add the attribute enableConfigurationOverride="false" to your appPool in the applicationHost.config file (located in %WINDIR%\System32\inetsrv\Config and %WINDIR%\SysWOW64\inetsrv\config) as in the following example:

<add name="MyAppPool" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" enableConfigurationOverride="false">
    <processModel identityType="NetworkService" />
</add>

Matteo

Romias

I think the problem is related that they are one site inside the other. Like a Website with a Virtual Directory inside.

In this case... the Virtual Directory web.config is "inheriting" the parent web.config

Here you can see details of how to solve this: How to stop inheritance of <configSections>in Web.Config

Other options: https://stackoverflow.com/a/367372/7720

If the problem is in other parts of your web.config (not in the sections) you can just wrap the conflicting part with <location path="." inheritInChildApplications="false">.

Other option could be let the webservice grab the connection from the website.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!