Visual Studio 2008 Web Project problem with PNG files

Posted by NoCarrier on Stack Overflow See other posts from Stack Overflow or by NoCarrier
Published on 2009-09-03T05:16:23Z Indexed on 2010/03/29 23:03 UTC
Read the original article Hit count: 334

Filed under:

I've added a PNG file to a directory in my VS2k8 webforms project, and when I run the app, it refuses to render my image - it even knows the dimensions but renders a box with a red X.

Oddly enough, if I double click the PNG file within VS2k8, it opens up in the IDE and displays fine (but only within the IDE).

Does anyone have any clues?

The path is correct.. I just have a basic default.aspx page with this in the body

  <img src="img/logo.png" />

if i navigate to img/logo.png in the browser, it shows a box with the same dimensions as my image, but a red x. Its finding the image, just not rendering it. It's showing up in IE running under the vs2k8 web server (localhost:5512/default.aspx)

I've dropped a JPG in the same directory, and it shows up just fine.

I'm not sure what type of PNG it is, but here is the kicker.... If i make an HTML file that references that image, copy both this HTML file and PNG file to my webserver (or just double click on the HTML page), it comes up JUST FINE.

Its leading me to believe that the Visual Studio web server may not recognize PNG files (at least this one) properly?

© Stack Overflow or respective owner

Related posts about visual-studio