Asp.net mvc 4 使用iis8 mvc4时定义了重复的日志记录配置

Asp.net mvc 4 使用iis8 mvc4时定义了重复的日志记录配置,asp.net-mvc-4,iis,web-config,iis-8,Asp.net Mvc 4,Iis,Web Config,Iis 8,我正在尝试在IIS中运行应用程序。当我在IIS Express中运行它时,它工作正常,但当我在IIS中运行它时,只会出现如图片所示的错误,请放大浏览器以清除错误图片。我找不到哪里出了问题。所以请帮忙 这是我的web.config <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID

我正在尝试在IIS中运行应用程序。当我在IIS Express中运行它时,它工作正常,但当我在IIS中运行它时,只会出现如图片所示的错误,请放大浏览器以清除错误图片。我找不到哪里出了问题。所以请帮忙

这是我的web.config

<configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null" requirePermission="false" />
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" />
    <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
      <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
      <section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
      <section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
      <section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
    </sectionGroup>
  </configSections>

在IISExpress中运行良好

这是我运行此命令时命令中的结果 findstr/p/s/i/c:loggingConfiguration c:*.config 正如kev所说

与IIS一样,错误消息中有线索:

无法访问请求的页面,因为该页面的相关配置数据无效

这告诉我们,
web.config
文件有问题

配置错误定义了重复的“loggingConfiguration”部分

IIS告诉我们它发现了重复的配置部分


9:能否将web.config文件的顶部包括在内?它在IIS中运行良好Express@SanjayMaharjan-可能是这样,但是您是否检查了
web.config
文件中重复的配置部分?@SanjayMaharjan-还检查了父目录,您的站点可能继承了一个
web.config
文件。它是父web配置,据我所知,任何地方都没有重复的日志配置。相同的项目在其他计算机上运行
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config