Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
697 views
in Technique[技术] by (71.8m points)

asp.net mvc 4 - "Entry has already been added" - Two Separate App Pools

I am creating a test version of an existing production site. A virtual web service application exists inside the site - and the two web configs have the same connection string.

There are no "clear" tags in the production web configs and the site and the web service co-exist merrily on two separate app pools.

On the test site however, every time I browse to the webservice URL I receive the Configuration Error "The entry 'ConnectionString' has already been added."

The test site and corresponding virtual application use their own separate app pools. Any ideas?

Thanks Jim

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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%System32inetsrvConfig and %WINDIR%SysWOW64inetsrvconfig) as in the following example:

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

Matteo


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...