Wow... where do I begin...

Ok...

here's the scenario"

1) You have an ASP.NET web project.
2) You make a call to a class file inside the project
3) The class file has a function that should read an image from the same web, and return its image data. I use WebClient.DownloadData for this, since I always get security errors with FileStream.

4) You run the project, but get ACCESS DENIED.

5) You find over 2 days of attempts, that IIS seems to squash ip addresses but gracefully allows domain names.

This has been trying me for ages, and I still have no simple solution.

The class needs to map to the image, and all it knows is the image lies inside a folder called Data inside the web (relative url would be /Data/myimg.jpg). So the class needs to be sent a string that dictates the mapped path of the server from which the web is operating, because WebClient doesn't work with relative url's and neither does FileStream.

I assume the class runs under ASPNET account. So I add ASPNET via the IIS tool and give it proper permissions.

Works great.

I deploy the project to a web server which has no domain name, but rather an ipaddress 192.168.1.xxx

Somewhere between IIS and ASP.NET the whole thing breaks down and returns an ACCESS DENIED error.

It appears the two have problems using an ipaddress to grab the image, because if I use the domain name instead, it works.

Anyone else have this problem before?