开发者

SVG elements not rendered locally, but remotely?

In my ASP .NET application, my SVG elements are not being rendered properly. I suppose it's because of some MIME-type complication.

Below you see my Web.Config file.

<?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"/>
      </prot开发者_高级运维ocols>
    </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>

What could be causing this? I can reconfirm the issue in all browsers.


I fixed this by using IIS express. You can't modify mime-types in Visual Studio's inbuilt development server.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜