IIS 10.0详细错误:mimeMap

时间:2017-10-25 09:46:43

标签: asp.net iis

你好,所以我很擅长使用IIS和Visual Studio,但是我已经设法在IIS上启动了一个网站但是当我尝试启动这个网站时,我在页面上出现了这个错误:

enter image description here

错误讯息:

  

无法添加“mimeMap”类型的重复集合条目,并将唯一键属性“fileExtension”设置为“.mp4”

有一节内容为 Config Error: ,所以这是我的 web.config 文件:

<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="DetailLogging" value="True"/>
<add key="LoggingConfigFile" value="log4net.config"/>
<add key="DatabaseConnectionString" value="Integrated Security=True; MultipleActiveResultSets=True; Data source=.\SQLEXPRESS; Initial Catalog=WebEvaluation" />

<add key="Email" value="***********************"/> 
<add key="SupportEmailID" value="*************************"/> 
<add key="ForgotPasswordEmailSubject" value="Butterfly Scheme e-Certification Admin Console - Password Request"/>
<add key="WelcomeMailSubject" value="Butterfly Scheme e-Certification Admin Console"/>
<add key="PasswordChangedMailSubject" value="Butterfly Scheme e-Certification Admin Console - Password Changed"/>
<add key="PasscodeDeleteMailSubject" value="Passcode delete notification - "/>
<add key="Host" value="***********"/>
<add key="PortNo" value="25"/> 
<add key="Password" value="***********"/>
<add key="SiteURL" value="***********************************"/>
<add key="RecordsPerPage" value="20" />
<add key="PasscodeCreateMailSubject" value="Butterfly Scheme e-Certification Passcode List created for : "/>    
<add key ="XlsConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}; Extended Properties='Excel 8.0;IMEX=1'"/>
<add key ="XlsxConnectionString" value="Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties='Excel 8.0;'"/>   
</appSettings>

<system.web>
<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=******************"/>
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=******************"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  </assemblies>
</compilation>
<httpRuntime requestValidationMode="2.0" maxRequestLength="2097151" 
executionTimeout="900"/>
<sessionState mode="InProc" timeout="20"/>
</system.web> 

<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<staticContent>
  <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
  <mimeMap fileExtension=".m4v" mimeType="video/m4v"/>
  <mimeMap fileExtension=".3gp" mimeType="video/3gpp"/>
</staticContent>
<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147482624"/>
  </requestFiltering>
</security>
</system.webServer>
</configuration>

2 个答案:

答案 0 :(得分:0)

您可以添加以下内容:

<remove fileExtension=".mp4" />

或者,由于MP4 mime类型似乎已经存在于根配置文件中,因此只需省略整行:

<mimeMap fileExtension=".mp4" mimeType="video/mp4"/>

如果您确实希望确定您所需的扩展程序存在,则可以替换staticContent标记:

<staticContent>
    <remove fileExtension=".mp4" />
    <remove fileExtension=".m4v" />
    <remove fileExtension=".3gp" />

    <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
    <mimeMap fileExtension=".m4v" mimeType="video/m4v"/>
    <mimeMap fileExtension=".3gp" mimeType="video/3gpp"/>
</staticContent>

答案 1 :(得分:0)

无法加载类型&#34; PresentationLayer.Global&#34;

检查您的名称空间是PresentationLayer还是已更改?如果更改,请在标记中更新它,右键单击Global.asax并选择&#34;查看标记&#34;