svg is not working on IIS webserver on localhost svg is not working on IIS webserver on localhost asp.net asp.net

svg is not working on IIS webserver on localhost


Your IIS is most likely not configured with SVG as a content type, try adding

<staticContent>    <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /></staticContent>

inside the <system.webServer> scope of your web.config.

This will of course only work if your application is the one serving up the svg. If the svg is not contained inside your application but in a separate directory of the web server, you'll need to add the same mapping to your web server instead inside the "mime-types" tab.


Try This - Your App/Website under Default Settings of IIS Manager

 Default Site Under IIS Manager

Then "Add" -> { .svg : image/svg+xml }


from web.config

<system.webServer>    <staticContent>        <remove fileExtension=".svg" />        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />    </staticContent></system.webServer>

or in IISgo to MIME Types and add file name extension:.svgMIME Type: image/svg+xml