Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem with icon path after switching from IIS to cassini
mgalex
#1 Posted : Monday, November 5, 2007 2:19:12 AM(UTC)
Groups: Member
Joined: 11/5/2007(UTC)
Posts: 4
Location: Romania

I use an webmail application for accessing XMail and I just switched from IIS to Cassini and everything seems to work fine.
It's just that the icons that the application uses do not appear.
For example there is somethin like that in the code....

<div class="button-head"><img src="/_gfx/icons/sysinfo.gif" alt="icon" title="System information">
System information
</div>

But the sysinfo.gif doesn't appear...only the alternate text does.
The application resides in C:\webmail and the path to sysinfo.gif is C:\webmail\_gfx\icons\sysinfo.gif .

Any ideas would be very appreciated. Thanks.

And sorry to bither you with such (probably) trivial matters but I just can't seem to figure it out.
Ultidev Team
#2 Posted : Monday, November 5, 2007 4:44:15 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

It is not very trivial, actually. It looks like your URL is correct, so the most common cause of this problem is that unlike IIS, Cassini applies authentication rules to all requests, including .GIF, .JPG, .CSS, etc., and not only to requests for ASP.NET resources. For example, if you create web.config that requires user to authenticate before getting access to the folder, even graphics resources won't be served from such folder. Also, if you have authentication HTTP Handlers, they will also be in invoked for .GIF requests, while by default in ASP.NET/IIS combination if resource is served by IIS itself, no HTTP handler will be called.

Please check out our previous threads on this topic:
- Web.config Authentication setup affecting access to static resources.
- IHttpHandler behaviour difference between Cassini and IIS.

Please let us know if this has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mgalex
#3 Posted : Tuesday, November 6, 2007 10:28:44 AM(UTC)
Groups: Member
Joined: 11/5/2007(UTC)
Posts: 4
Location: Romania

Hello again....and thanks for the quick answer. I read the links you gave me...but I still didn't figure out the problem.

I only have one Web.config in the root folder of the web application.
It first contains a
<authorization>
<allow users="*" />
</authorization>

and then...further down the file several parts like
<location path="User">
<system.web>
<authorization>
<allow roles="user" />
<deny users="*" />
</authorization>
</system.web>
</location>

But the icons are in the '_gfx' folder which is not in such a 'location' element...and is also not a subdirectory of any path which is in a 'location' element. The _gfx folder is actually in the root folder of the application.
I tried adding a location element for the _gfx folder like ...
<location path="_gfx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

but didn't help much.

Thanks for the help.
Ultidev Team
#4 Posted : Tuesday, November 6, 2007 12:02:08 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi again!

Well, now looks like you will need to intercept http traffic to see what is being requested and returned. We recommend using Fiddler to trace the http traffic - it is exceptionally easy to use. Just install and run Fiddler on the same box where you run your browser and then browse to your application using machine name instead of localhost in the URL. For example: http://machine:1234/. Then in Fiddler you will see all request/response pairs in the Session Inspector tab. There you will see what exact image URL were requested, and how Cassini has responded. Please post one of the responses - we may be able to tell what's going on by looking at it.

Best wishes,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mgalex
#5 Posted : Wednesday, November 14, 2007 3:09:21 AM(UTC)
Groups: Member
Joined: 11/5/2007(UTC)
Posts: 4
Location: Romania

Ok. So here is a copy&paste fom Fiddler from Session Inspector tab.

THE REQUEST:

GET /_gfx/icons/welcome.gif HTTP/1.1
Host: www.arceonline.ro:801
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: http://www.arceonline.ro:801/Default.aspx?t=128395187718906250
Cookie: Test=CookieSupport=yes


THE RESPONSE:

HTTP/1.1 200 OK
Server: UltiDev Cassini/1.1.3.4
Date: Wed, 14 Nov 2007 12:59:32 GMT
X-AspNet-Version: 1.1.4322
Cache-Control: public
ETag: "1C4C3714DF77400:1C826A5032686D8"
Content-Type: image/gif; charset=utf-8
Content-Length: 484
Connection: Close

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
GIF89a

If you can get any new information from this....I couldn't :)

Thanks.
Ultidev Team
#6 Posted : Wednesday, November 14, 2007 3:51:28 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Response looks almost right, with the exception of
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
before "GIF89a+" signature of a GIF file.

If you open the GIF file in the Notepad, do you see the line above in it? You probably won't. Also, what is the size of the file: is it 484 byte or is it 484 minus length of the string above?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mgalex
#7 Posted : Monday, November 19, 2007 12:30:16 AM(UTC)
Groups: Member
Joined: 11/5/2007(UTC)
Posts: 4
Location: Romania

I don't see the line above in Notepad.

The size of the file is 375 bytes. So if the line above has 109 bytes (which I think it does incuding the new line) then 484 - 109 = 375
Ultidev Team
#8 Posted : Monday, November 19, 2007 4:50:07 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
(We have highlighted the line in your previous post). Well, this problem is not anything we are familiar with, but we'll try to help you troubleshooting it.

Theoretically, something like this could happen if web.config of your application, or machine.config of .NET Framework 1.1, adds an HttpHandler or HttpModule that changes the response in the way we saw. Pretty often, when people are writing handlers and modules, they test them only with IIS in its default configuration, which routes only ASPX, ASMX, ASHX (asp.net) requests to ASP.NET and the rest - .JS, .JPG, etc. is handled outside of asp.net. In Cassini (and some IIS setups) ALL requests, including those for .GIF, .JPG, .CSS, etc. - are routed through ASP.NET, which means all handlers, modules, and Application_XXXX methods of Global.asax get to look and tweak the response. So the first thing to try is to check web.config and machine.config for non-Microsoft handlers and eliminate them temporarily to see if that makes a difference.

Please let us know if this has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (10)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.