1
votes

I have a website that runs on IIS on an internal server.

static ip

It display fine when running from my local host. however, whenever I try to publish to my dev server, the images don't work.

And It looks like this

brokenImages

My first thought was that the images were not being transferred to the server. However I discovered this wasnt true, as I remotely connected to the server and found the images.

When I inspect the page, I get 404 errors for all the images. But the path for them seems correct. Goes to the properly named 'img' folder

404 errors

I thought maybe it was a permissions issue with the images folder as indicated by this post

Images not showing on published ASP.NET MVC Website

So I added

 <location path="img">
  <system.web>
    <authorization>
      <allow users="?"/>
    </authorization>
  </system.web>
</location>

And this did not change anything.

I checked to make sure none of the images in question were Encrypted through windows with the 'Encrypt contents to secure data' option under advanced image options.

After some more searching I came across this post,

http://blogs.msdn.com/b/ajay_pathak/archive/2011/08/06/website-deployed-on-iis-7-5-not-showing-images-and-css-files.aspx?CommentPosted=true#commentmessage

But i already have StaticFile enabled.

Finally I found this thread

CSS, Images, JS not loading in IIS

That suggested making sure anonymous authentication was set to 'application pool identity' instead of 'specific user'. I changed this and once again nothing has happened. I'm banging my head against a wall with this one. Please help.

1
Can you try with Absolute path for one of the images and see whether that works? Secondly what user is the IIS Web service running under? Does that user have permissions to that path?kanchirk
What if you point your browser to the images files, does that work? (i.e.Enter the url to image files into your browser)Rick S

1 Answers

0
votes

So as it turns out there was a folder structure issue.

Was deploying from an svn where the folder structure was placed in another project incorrectly. As a result the 'img' folder was actually in a different location then specified. Once I cleared this up and properly nested the project, my issues vanished.

Thanks for the help everyone.