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

Notification

Icon
Error

Published site issues under Cassini but not IIS
esaulsberry
#1 Posted : Monday, March 19, 2007 11:19:07 AM(UTC)
Groups: Member
Joined: 3/19/2007(UTC)
Posts: 3
Location: Loganville

Hello,
I created a simple test site with themes and resource files and deployed it with the "publish website" option in VS 2005. I've set it up to run under Cassini and IIS (5.1, XP pro box). It renders correctly from IIS but the stylesheets don't seem to be found from cassini. The link tag looks like this:
<link type="text/css" media="all" rel="stylesheet" href="css/StyleSheet.css" /><link href="App_Themes/MPP/StyleSheet.css" type="text/css" rel="stylesheet" /><link href="App_Themes/MPP/StyleSheet2.css" type="text/css" rel="stylesheet" />

Any idea why this might be? The code served to the browser appears to be the same.
Ultidev Team
#2 Posted : Monday, March 19, 2007 11:40:02 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.

We are not aware of any issues in Cassini that would cause this behavior. When testing together with IIS and Cassini, were they pointing to the same physical folder?

Also, after you've made sure CSS files were successfully uploaded to the server, can you point your browser to any of the CSS files and retrieve them using hard-coded URLs like http://localhost:<port>/App_Themes/MPP/StyleSheet.css? Does it load the CSS file or you get an error?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
esaulsberry
#3 Posted : Tuesday, March 20, 2007 5:55:22 AM(UTC)
Groups: Member
Joined: 3/19/2007(UTC)
Posts: 3
Location: Loganville

The IIS and Cassini sites are indeed pointing to the same folder. If I replace http://localhost:8523/Default.aspx with http://localhost:8523/App_Themes/MPP/StyleSheet.css I get the following exception:

[InvalidCastException: Unable to cast object of type 'System.Web.DefaultHttpHandler' to type 'System.Web.UI.Page'.]
ApplyThemeModule.app_PreRequestHandlerExecute(Object sender, EventArgs e) +40
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +138
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +65

Going through IIS, http://localhost/published/App_Themes/MPP/StyleSheet.css returns the css file (VisualStudio promptly opens it up).

The site is a small test site I built to test themes and resource files, and precompiled web sites. I'd be happy to send the whole thing to you.
Ultidev Team
#4 Posted : Wednesday, March 21, 2007 9:08:17 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)
Well, we are at loss - we never saw this issue before. Please contact us via email so we could respond and receive your project for analysis.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#5 Posted : Thursday, March 22, 2007 12:18:39 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)
For those interested, the problem was caused by the difference in how HTTP modules (IHttpModule) are handled in IIS and UltiDev Cassini. In our Cassini all modules registered in application's web.config will be called for all requests - not only for ASPX requests like in IIS in its default configuration.

Your IHttpModule code, however, should not assume it always handles only requests for ASPX files. If IIS is configured to send other file types to ASP.NET module, then your IHttpModule implementation will break if it assumes that HttpContext.Current.Handler is always of the System.Web.UI.Page type. While you may get away with such assumption in plain vanilla IIS, fancier configurations of IIS/ASP.NET, or UltiDev Cassini may break your code.

Always check the type of the HttpContext.Current.Handler before casting when you create your own HTTP module.

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
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.