I am able to get the SVG files to display using the object tag (img tag didn't work nor did background-image property) while running in debug mode using MS Visual Web Developer 2010 Express. My browser is IE11. But after publishing to the web, the SVG files do not show and will display the "alt" content when included. The img tag never works with SVG and the svg tag always works, even after being published to web. I only need to get the object tag to work however, and just included the others as additional information for figuring out what might be going on.
<body>
<form id="form1">
<img alt="image missing" src="Images/circle.svg" />
<object data="Images/circle.svg" type="image/svg+xml">object missing</object>
<svg>
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
</form>
</body>
When I replace the svg file with a png, then all three images display in debug as well as after publishing to the web. The png and svg files are kept in the same folder. I tried another browser (Chrome) with the same results. Any ideas as to why the svg wouldn't display? Thanks.
I resolved the issue. I had to add the .svg mime type to the application's web.config file. The following code was added to web.config and now all scalable vector graphics display in both the image tag and object tag in debug as well as released.
I found the solution here: https://serverfault.com/questions/359904/how-to-configure-iis-for-svg-and-web-testing-with-visual-studio
and here: http://www.codeproject.com/Tips/439273/Viewing-SVG-and-other-HTML5-content-when-debugging