I am trying to display .svg files in my web application using Visual Studio 2012, IIS Express v8.0 and ASP.NET web forms.
Things I've already tried:
- Adding the .svg extension to web.config
<staticContent> <remove fileExtension=".svg" /> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> </staticContent>
- Adding the .svg extension to C: \ Users \ UserName \ Documents \ IISExpress \ config \ applicationhost.config
<staticContent lockAttributes="isDocFooterFileName"> ... <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> ...
- Copy the image URL into the browser and display it.
4. Publish the site under IIS and display it. In addition, we have a developer using Visual Studio 2013, and it perfectly displays the use of IIS Express v8.5.
I add .svg icons as icons using a span element with a class that has a file URL as a background, so I cannot use this solution: SVG files in VS2012
This is the style of the class added to the span:
background: transparent url(images/svg/reports.svg) no-repeat scroll 0px 0px;
What's happening?
source share