home links tools blog about

AngryPets Blog

home

Cassini to the Rescue!


Right now I'm so livid I can barely stand it. Or at least I was a few minutes ago.

What got me so mad? The vile combo of ASP.NET/IIS 5.1/VS.NET.

I'm sorry, but that combo just outright SUX0RZ!

Yeah, MS knows all about and is FIX0R1NG it in 2.0, but right now it BLOWS CHUNKS

Why does it suck? Well it's all the nonsense about projects and virtual directories -- and all the havoc that combination creates. See I've been playing around with a spiffy little HTTPModule and HTTPHandler combination to take care of a custom download handler (along with the requisite authentication). The HTTPModule / HTTPHandler were created in a library.. and dropped into the root of my site. But then I wanted to debug and see what happens in a few test scenarios. You obviously can't debug a library unless it's running within a context... so I created a quick and dirty web project to act as a segway into my module/handler. Only there's a problem we ALL know only too well: Once I create that project it becomes a virtual directory. Then when I try to start up my solution (in the web project) I get compiler errors telling me that the site can't find the .dlls specified by the web.config. The real pisser here is that the web.config it's using is my ROOT web.config, and the reason I'm getting exceptions is the fact that the VIRTUAL directory can't find the code for the module in question. (i.e. /virtual_dir/bin doesn't contain my custom .dlls (well duh.. they're in /bin !)

That left me with a few options.
The first, and seemingly easiest was just to DITCH the virtual directory/project nonsense and just open up VS.NET and bind to aspnet_wp.exe and debug from there. That SHOULD have worked.... only with the amount of virtual directories that I had (I've got about 3-4 that I ACTUALLY use on my machine for various little apps/etc, plus I've got two virtual directories for Vault (boy do I love Vault)).. anyhow with the amount of virtual directories running around apparently the debugger got scared/lost. I'd try and nav out to a site in a browser and................... bupkiss?! No cpu spikes/thievery/evil/etc; just nothing... Just blank stares from the browser and no LOVE AT ALL from VS.NET... that sucked.
The second option, which I didn't think of until I started writing this entry, was to go into my virtual directory, and tell it via the web.config to NOT include my handler and module in the virtual directory. That probably would have allowed me to use my virtual-directory/web-project hack as a nice way of pointing the direction for VS.NET.
The Third option, which is what I chose tonight made a lot more sense: ditch IIS and go for Cassini. It worked flawlessly... so let me elaborate a bit.

I completely understand why MS doesn't let IIS 5.1 host more than just the 'default' site -- they don't want people spending money on XP to furnish web servers instead of buying server licenses... Fine. What would be NICE though: If I've plunked down the cash for VS.NET... let it unlock IIS 5.1 to IIS 5.12 (or something) which would allow say... 3 sites, or unlimited sites. Why should I care? Well, cuz anybody who devs for a few sites (mine are all effectively hobby site) knows that IIS 5.1 is a miserable tool for trying to maintain multiple sites. There's simply no course of action other than to go with virtual directories (which means that your dev environment doesn't even remotely resemble your prod environment)... or just get used to moving your root around each time you want to play with a different site. Both options suck.

SIDENOTE: There's another component here that needs explanation: Dreamweaver. It's a swell tool (not too impressed by the bloat/laggishness of MX 2004 though) that does a fine job for html markup. Only I HATE the way that the preview works; when I open a browser window and preview what I'm working on I hate having to close that window, tweak in DW, and then repreview to a new window... it just rubs me the wrong way the way they use temporary files for the preview (temp files that won't refresh with your changes when you save and hit refresh). So I've resorted to just opening up the page(s) I'm working on via IIS... which is why I find myself in the predicament of not liking IIS for toggling back and forth between a few sites...

In the end, this all makes me a big complainer... but the truth of it is that I spend a good deal of time in this environment and waste/inefficiency just bugs me.

Enter Cassini. Man what an incredible tool. Every ASP.NET Developer should seriously take the thing for a test-drive. Simple, clean, efficient, and free from the cobbling of IIS 5.1 as well as the imposed nastiness of VS.NET/ASP.NET 1.0/1.1's crippling project/virtual-directory ONLY development. *takes breath... wipes spittle from corner of mouth* You can install the thing in a matter of minutes, and within a few seconds get it up and running serving multiple sites on your box.... without the headache of juggling virtual directories and the likes to keep them all separate.

I've just created some batch files for the few sites I care about and double-click the batch files when I want to start up a site (I'll jump in and tweak the winform one of these days to pull from the/a config file with a dropdown that lets me just start one of my sites). This has made everything super nice. I can keep mirrors of my production sites on my hard-drive and instantly turn the directories into websites with a simple double-click of a .bat. With that in place I can then open up DW and edit in DW, and just keep a browser window pointing to Cassini open. When I make a change in DW and hit CTRL+S I can then jump over and hit F5 on my browser and see the changes instantly... and I _could_ do this with all my sites if I were so inclined. I can also make similar changes in VS.NET (I still compile etc..) But I just like not having to mess with IIS 5.1 to 'simulate' these sites when I want to work on them. To me that's the juicy part of Cassini: Until tonight... when it made my life soooo much better by getting me into a state where I could easily debug. So I'm torn on just which aspect is the most 'awesome'... either way the tool/server rules!

I guess what it all boils down to is this notion that I've got some pretty expensive/powerful tools: XP and IIS 5.1 (hey, it's a good tool... no other OS compares). Then I've got ASP.NET (which I love) but currently it's been cobbled by VS.NET ... that's just sad cuz I shouldn't have to dumb-down my apps to account for failures in my tools... but that's exactly what VS.NET requires currently.... Cassini, with beautiful simplicity, allows me the freedom to develop my apps as necessary without dumbing them down. That's HUGE...


posted on Thursday, September 16, 2004 10:49 PM
 

Existing Comments:

# re: Cassini to the Rescue! - Posted: 9/17/2004 12:39 PM - By: Brian
   I have to give this a try (I'll keep saying that for the next 6 months). One way to help with IIS' 5.1 limitations is to use IIS Admin (bad name, cool tool) that can be found here:
http://www.mindxpand.be/iisadmin/

It lets you set up multiple sites on a box, and easily run any of them. You still can only have 1 site running, however.


# re: Cassini to the Rescue! - Posted: 9/17/2004 2:59 PM - By: Jon
   You should write an article with more specifics on how you set up Cassini as you've described. Then you could, uh... send it to me.


# re: Cassini to the Rescue! - Posted: 9/20/2004 8:10 PM - By: Scott Mitchell
   I have had issues with Cassini and ViewState corruption when working with WebForms with large view states. Have you ever encountered this?


# re: Cassini to the Rescue! - Posted: 9/21/2004 1:01 PM - By: Michael K. Campbell
   Scott,

I've not experienced the issues you've mentioned, but that's probably just because I've not done much in the way of 'heavy-lifting' with Cassini in terms of view state.
I plan on making a few mods that I'll open source for Cassini in a while and as I work on those I'll be sure to keep an eye out for view-state issues.
About how many K of viewstate are we talking about here?


# re: Cassini to the Rescue! - Posted: 3/29/2005 3:44 AM - By: vipul soni
   the biggest problem with cassini is that the user cannot define a virtual directory if used , on the intranet.


# re: Cassini to the Rescue! - Posted: 3/29/2005 7:53 AM - By: Michael K. Campbell
   Vipul,

Check out CassiniEX.
http://www.systemex.net/CassiniEx/

It adds the ability to create virtual directories in Cassini.



Add your own comment:


Go to http://blog.angrypets.com where comments are enabled.