What are the (dis)advantages of using Cassini instead of IIS?

asp.netVisual StudioIisCassini

asp.net Problem Overview


I've found that on some occasions I can edit the source while debugging. Are there any other advantages of using the Visual Studio built-in webserver instead of a virtual directory in IIS?

I'm using Windows XP on my development environment, and a local instance of IIS 5. I work on several projects, so I use multiple virtual directories to manage all the different sites.

Are there any disadvantages?

asp.net Solutions


Solution 1 - asp.net

The built-in web server for Visual Studio is called Cassini and here are a few of its limitations...

  • It can host only one ASP.NET application per port.
  • It does not support HTTPS.
  • It does not support authentication.
  • It responds only to localhost requests.
  • It is slow startup compared to IIS

Solution 2 - asp.net

All the previous responses are great answers - here's one gottcha with Cassini that might require IIS on the destkop.

Cassini runs in the context of the developer, not as the IIS user (IUSR_, IWAM, or in WinXP x64, the w3wp process). This can be a bit painful if you've got a web site that is accessing external files or creating temp files. It is most evident when your developer is running as an Admin of their desktop.

When you move to the server IIS, something that you would have had access to in Cassini doesn't work the same. CACLing with the IIS_WPG usually is all it takes to fix, but if your developer is not thinking about this, they will quickly get quite frustrated with their deploy.

Solution 3 - asp.net

Cassini does not support virtual directories.

Solution 4 - asp.net

It looks like a third option is coming soon:

IIS Express.

Solution 5 - asp.net

The built-in server works well for larger corporations that don't want to give developers any administrator access on their own machines to configure IIS.

Solution 6 - asp.net

The Visual Studio web server is less forgiving about // in the path.

It will refuse to serve a link like http://localhost:52632/main//images/logo.jpg where IIS will do.

That's pretty obscure, but it means we have a lot of fixing to do to get rid of all the // occurrences.

Solution 7 - asp.net

Another disadvantage I've run into is on a Forms authenticated website using custom IPrincipal/IIdentity. Cassini will switch the AppDomains without warning (or notice).

Check this blog post for more.The headache on this made me drop Cassini and stick with IIS.

Solution 8 - asp.net

[There's a bug in the way the built-in server handles HTTPModules][1] - there is [a workaround][2], but I hate having to put in code that'll never be needed in production.

[1]: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=274696 "Using Custom Identities in ASP.NET fails when using the ASP.NET Developement Server" [2]: http://www.lhotka.net/weblog/UpdateOnMyStrugglesWithTheASPNETDevelopmentServer.aspx "Search the comments for 'John Lewicki'"

Solution 9 - asp.net

  • You need to have Visual Studio running to use it (under normal circumstances)

  • It only responds to localhost, so you can't give the link http://simon-laptop:37473/app1 to a friend to view your site over the network

  • Big disadvantage: it's harder to get [fiddler][1] working, because localhost traffic isn't sent through the proxy.

Using http://ipv4.fiddler:37473 is the best way to get Fiddler working with it.

[1]: http://www.fiddlertool.com "Fiddler"

Solution 10 - asp.net

If you 'web reference' the URL for web services that are on the built-in webserver, the port might change. Unless you have set a "Specific port" mentioned in menu ProjectProperties options page.

This is something I've gotten used to now. I always set a specific port. Now when sometimes the webserver crashes (I've had that happen), I simply change the port number, and all is well. I reckon restarting will also fix this.

Solution 11 - asp.net

The built-in server means the developer doesn't have to know how to set up IIS to test their site.

You could argue this is a disadvantage, and that a Windows developer should know at least that much IIS. Or you could argue that a developer who isn't a system administrator shouldn't be messing around with the web server at all.

Solution 12 - asp.net

Cassini also does not support ASP Classic pages. This is only an issue for legacy projects where old ASP Classic pages still exist (like our web application at work).

Solution 13 - asp.net

You cant use virtual directories :(

Solution 14 - asp.net

If you do hobby work at home using XP Home, you can't install IIS locally.

Solution 15 - asp.net

The built-in server isn't as configurable, and it runs on an odd port, so if you're counting on specific behavior it can be troublesome.

Solution 16 - asp.net

I often take the best of both worlds and create an application in IIS, and use the built-in web server for more efficient debugging.

Solution 17 - asp.net

Cassini is meant to be a lightweight test webserver. The idea is that a developer does not need to have IIS installed and configured to test his/her application.

Use IIS if you are familiar with it and you have it set up and your box can handle it. Cassini is not meant to be a replacement.

Solution 18 - asp.net

When you use IIS in Vista or Windows 7 with UAC enabled, you must run Visual Studio with administrative rights. If you do this, you can't drag an drop from your shell to Visual Studio (even if you run an instance of explorer.exe as administrator).

For this reason I use Cassini for most projects.

Solution 19 - asp.net

FYI, Windows XP 64-bit comes with IIS 6.

Solution 20 - asp.net

This is an old thread started 2 years ago. I just stumbled upon UtilDev Cassini while googling. Looks promising to me. At least it has the ability to run multiple sites simultaneously. That feature is really useful for me, because I work on 2 different sites and have to continuously switch between them using IIS.

Solution 21 - asp.net

Here's a reason for a third way: although UWS Pro is probably closer to IIS than Cassini (although inspired by Cassini and is from the vendor of the UltiDev Cassini fork), its main purpose is to be redistributable along with ASP.NET applications. enter image description here

Solution 22 - asp.net

Install IISAdmin, and you can setup separate sites in IIS 5, instead of using virtual directories.

Solution 23 - asp.net

The built-in webserver is a little less robust than IIS, but requires no setup so it is just a tradeoff.

You may not always want your development projects exposed on your IIS server (even your local IIS server) so the built-in server is good for that.

However, if your application is going to access resources outside of the norm for a web app then you may want to debug frequently in IIS so that your app will run with restricted permissions and you can see where the pain points will be.

Solution 24 - asp.net

We've also seen some issues with Visual Studio built-in server regarding some third-party controls which put their scripts in the \aspnet_client folder.

Since the folder isn't there when you're not running under IIS, the controls didn't work. It seems a lot simpler to always work with IIS and avoid strange problems.

Solution 25 - asp.net

One difference I've found is that the development server handles uploading files differently than IIS does. You can't trap the error if the file being uploaded is bigger than your Max_File_Size setting. The page just dies and returns a 500.

Solution 26 - asp.net

Another dis-advantage is that it sends every request through the gloabal asax file which includes all requests for images and stylesheets. This means if you have code in there which does things with the file names, such as a look up, then the auxillary files willget processed too.

Solution 27 - asp.net

Also via IIS, you don't have to worry about automatically remembering and setting a stupid port number in your localhost url. That's something funky directly relied upon with Cassini...big pain in the ass. Who wants to remember some abritrary port number. Just run the damn site in IIS..plain and simple.

Solution 28 - asp.net

If your project resides in the IIS directory you can still edit code. It just depends if it has been published or not.

You will run into so many issues on the Cassini vs. IIS when you are debugging certain permission based scenarios, like Kerberos and NTLM authentication as well as issues like server compression, etc. All in all, the Cassini is still okay to develop with, but make sure you do extensive testing when publishing to IIS.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsebastiaanView Question on Stackoverflow
Solution 1 - asp.netpdavisView Answer on Stackoverflow
Solution 2 - asp.netChristopher G. LewisView Answer on Stackoverflow
Solution 3 - asp.netJohn SheehanView Answer on Stackoverflow
Solution 4 - asp.netGlen LittleView Answer on Stackoverflow
Solution 5 - asp.netJoel CoehoornView Answer on Stackoverflow
Solution 6 - asp.netSimon_WeaverView Answer on Stackoverflow
Solution 7 - asp.netHavaganView Answer on Stackoverflow
Solution 8 - asp.netGreg HurlmanView Answer on Stackoverflow
Solution 9 - asp.netSimon_WeaverView Answer on Stackoverflow
Solution 10 - asp.netVinView Answer on Stackoverflow
Solution 11 - asp.netJoel CoehoornView Answer on Stackoverflow
Solution 12 - asp.netGilliganView Answer on Stackoverflow
Solution 13 - asp.netToby MillsView Answer on Stackoverflow
Solution 14 - asp.netJoel CoehoornView Answer on Stackoverflow
Solution 15 - asp.netJoel CoehoornView Answer on Stackoverflow
Solution 16 - asp.netSimon_WeaverView Answer on Stackoverflow
Solution 17 - asp.netMatthew M. OsbornView Answer on Stackoverflow
Solution 18 - asp.netChrisView Answer on Stackoverflow
Solution 19 - asp.netRichard SzalayView Answer on Stackoverflow
Solution 20 - asp.netAlwaysAProgrammerView Answer on Stackoverflow
Solution 21 - asp.netVladHView Answer on Stackoverflow
Solution 22 - asp.netFlySwatView Answer on Stackoverflow
Solution 23 - asp.netJamesView Answer on Stackoverflow
Solution 24 - asp.netDoron YaacobyView Answer on Stackoverflow
Solution 25 - asp.netuser13810View Answer on Stackoverflow
Solution 26 - asp.netDaisyView Answer on Stackoverflow
Solution 27 - asp.netPositiveGuyView Answer on Stackoverflow
Solution 28 - asp.netQuintin RobinsonView Answer on Stackoverflow