views:

148

answers:

1

On Windows XP I am working on a .NET 3.5 web app that's a combination of WebForms and MVC2 (The WebForms parts are legacy, and being migrated to MVC). When I run this from VS2008 using the ASP.NET web server everything works as expected.

However, when I host the app in IIS and try to use it, I see the following error

Section or group name 'cachingConfiguration' is already defined.
Updates to this may only occur at the configuration level where it is defined.

Source Error: 
Line 24:     </sectionGroup>
Line 25:     <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
Line 26:     <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 27:   </configSections>
Line 28: 

Sure enough, if I remove the offending line (line 26 in the error message) from my web.config then the app runs correctly.

However, I really need to find out where the duplicate definition of this is. It's nowhere in my solution. Where else could it be?

Edit

Some additional information:

This is the only application I'm working on, so rather than add a virtual directory in IIS I've simply repointed the local path of the Default Web Site to point at my site.

A: 

Yoy can check the machine.config file since all settings from it are inherited by your web application. In asp.net 4.0 a lot of things were moved there in order to decrease the complexity of the web.config file. The path to it is x:\$Windows$\Microsoft.NET\Framework\$version$\config\machine.config , where x:\$Windows$ is the directory in which Windows is installed on your machine and $version$ is your .net framework version.

Branislav Abadjimarinov
No luck there - I checked in the `machine.configs` for v2.0.50727 and v1.1.4322, no mention of `cachingConfiguration` in either...
Richard Ev
As I see from the question's tags you are using IIS5. in that case it is good to check if your site folder is set as an application in the IIS Management console. You can check this thread http://forums.iis.net/t/1155294.aspx for more info.
Branislav Abadjimarinov
Thanks again Branislav - changing that didn't make a difference either
Richard Ev