IIS 10.0详细错误:mimeMap [英] IIS 10.0 Detailed Error: mimeMap
问题描述
你好,所以我很擅长使用IIS和Visual Studio,但我已经设法在IIS上启动了一个网站但是当我尝试启动这个网站时,我在页面上出现了这个错误:
Hello so I'm pretty new to using IIS and Visual Studio but I've managed to launch one website on IIS but when I try to launch this one I get this error across the page:
错误消息:
无法添加mimeMap类型的重复集合条目,其唯一键属性fileExtension设置为.mp4
Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.mp4'
有一节读取 配置错误:
所以这是我的 web.config
档案:
There's a section that reads Config Error:
so here is my web.config
file:
<?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>
推荐答案
您可以添加以下内容:
<remove fileExtension=".mp4" />
或者,因为MP4 mime类型似乎已经存在于根配置文件中,所以只需省略整行:
Or, since the MP4 mime type seems to be already present in the roots configuration file, simply omit the whole line:
<mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
如果你真的想确定你似乎需要的扩展名存在,这可能是一个替换 staticContent
标记:
If you really want to be sure that the extensions you seem to require are present, this could be a replacement for the staticContent
tag:
<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>
这篇关于IIS 10.0详细错误:mimeMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!