开发者

Section or group name 'cachingConfiguration' is already defined - but where?

开发者 https://www.devze.com 2022-12-30 02:45 出处:网络
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 we

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.


You 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消