SVG图像不显示asp.net mvc 4

And*_*rew 1 asp.net-mvc xhtml svg image

我有svg格式的图像.当我在一个简单的html上使用它时,它显示,但当我尝试在一个真实的项目(asp.net mvc 4,visual studio 2010)中使用它时,它不会显示.

    @model KZStream.Web.Site.Models.IamSelling.IamSellingModel
@using KZStream.Web.Site.Resources.Views.Products
@{
    Layout = "~/Views/Shared/_Mobile.cshtml";
}
<div id="wrapper">
    <div class="top-pannel">
        <div class="tp-languge">
            <a href="">???????</a>
        </div>
        <div class="tp-basket">
        </div>
        <div class="tp-sign-in">
            <a href="">?????</a>
        </div>
    </div>
    <header>
        <div class="main-page-header clearfix">
            <div class="mp-logo">
                <img src="/Content/images/mobile/MS_Logo.svg" alt="">
            </div>
            <div class="mp-join-us">
                <button class="kzstreambutton button-orange">
                    <span>??????????????</span>
                </button>
            </div>
        </div>
        <nav>
            <div class="main-page-menu">
            </div>
        </nav>
    </header>
    <div class="main-page-cont">
    </div>
    <footer>
    </footer>
</div>
Run Code Online (Sandbox Code Playgroud)

Mur*_*san 10

尝试直接访问.svg文件localhost:port/content/images/mobile/MS_Logo.svg.

如果您收到不支持文件类型的消息,可以在Web.config中将其添加到下面,以确保您的服务器能够提供.svg格式

<system.webServer>
  <staticContent>
    <remove fileExtension=".svg" />
    <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
  </staticContent>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)