2011-08-09 60 views
0

在我的ASP .NET应用程序中,我的SVG元素没有正确渲染。我想这是因为一些MIME类型的复杂性。SVG元素不是本地渲染的,而是远程渲染的?

下面你看到我的Web.Config文件。

<?xml version="1.0"?> 
<!-- 
    For more information on how to configure your ASP.NET application, please visit 
    http://go.microsoft.com/fwlink/?LinkId=169433 
    --> 
<configuration> 
    <configSections> 
    <section name="microsoft.visualstudio.testtools" type="Microsoft.VisualStudio.TestTools.UnitTesting.TestConfigurationSection, Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 
    </configSections> 
    <system.web> 
    <globalization culture="en-US" uiCulture="en-US"/> 
    <customErrors mode="On"/> 
    <pages validateRequest="false"/> 
    <compilation debug="true"/> 
    <webServices> 
     <protocols> 
     <clear /> 
     <add name="HttpGet"/> 
     <add name="HttpPost"/> 
     </protocols> 
    </webServices> 
    <sessionState timeout="1440" /> 
    </system.web> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    <staticContent> 
     <remove fileExtension=".svg" /> 
     <remove fileExtension=".svgz" /> 
     <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> 
     <mimeMap fileExtension=".svgz" mimeType="image/svg+xml" /> 
    </staticContent> 
    </system.webServer> 
</configuration> 

什么可能导致这种情况?我可以在所有浏览器中重新确认问题。

回答

1

我使用IIS Express解决了这个问题。您不能在Visual Studio的内置开发服务器中修改mime类型。