views:

4226

answers:

27

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?

A: 

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

Joel Coehoorn
I think the MS Web Platform Installer removes this limitation (I was able to install IIS on Vista Home)
Dan Finch
@Dan Finch Vista Home can run IIS. XP Home cannot.
Joel Coehoorn
+1  A: 

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

FlySwat
Though only run one at a time.
Richard Szalay
+5  A: 

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

Joel Coehoorn
A: 

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

Joel Coehoorn
It is possible to configure the port in VS. Project->Properties->Specific port
pdavis
+31  A: 

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.
  • Slow startup compared to IIS
pdavis
Fixed your bulleted line breaks, and upvoted for the https and authentication remarks (separate answers would have got you two votes).
Joel Coehoorn
LOL, I fixed them too:)
pdavis
"It responds only to localhost requests" ...can't stress that enough! That makes it pretty useless for real web serving
mcjabberz
Since its opensource, you can easily remove the localhost only limitation :). I did. Its easy.
Ali Kazmi
A: 

If your project resides in the IIS directory you can still edit code, just depends if it has been published or not. You will run into so 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 dev with but make sure you do extensive testing when publishing to IIS.

Quintin Robinson
+1  A: 

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 the Project->Properties 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.

Vin
A: 

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 sysadmin shouldn't be messing around with the web server at all.

Joel Coehoorn
A: 

I think really they are pretty similar, and I don't like working on either. IIS 5 is really out of date, and I am of the firm opinion that all asp.net developers should develop on a server platform either running it as your main operating system or at least in a vm. The differences between XP IIS 5/WS IIS and 2003 (and I guess 2008 now) are just too big when you really get into heavy website development.

Kevin
A: 

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.

James
+2  A: 

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

Greg Hurlman
+3  A: 

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 serve that file

Thats pretty obscure but meant we had a lot of fixing to do to get rid of all // occurance.

Simon_Weaver
+2  A: 

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

Gilligan
A: 
  • You have to have visual studio running to use it (under normal circumstances)

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

  • Big disavantage : its harder to get fiddler working because localhost traffic isn't sent through the proxy.

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

Simon_Weaver
you can trick fiddler into watching the local traffic by adding a period before the colon and port on your url.. examplehttp://localhost.:1234/MyAppOr using the fiddler passthrough http://ipv4.fiddler:1234
Quintin Robinson
Actually, you can run it from the command line, so you don't need visual studio running.
Jonathan Arkell
A: 

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.

Simon_Weaver
A: 

Cassini is ment to be a light waight test webserver. The idea is that a developer does not need to have IIS installed and configured to test his application. Use IIS if you are familier with it and you have it setup and your box can handel it. Cassini is not ment to be a replacement.

Matthew M. Osborn
A: 

We've also seen some issues with VS built-in server regarding some third-party controls which put their scripts at 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.

Doron Yaacoby
+8  A: 

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.

Christopher_G_Lewis
+4  A: 

Cassini does not support virtual directories

John Sheehan
A: 

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.

+3  A: 

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

http://www.lhotka.net/weblog/UpdateOnMyStrugglesWithTheASPNETDevelopmentServer.aspx

The headache on this made me drop Cassini and stick with IIS.

A: 

You cant use virtual directories :(

Toby Mills
A: 

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.

Chris
maybe someone should start a new question "What are the (dis)advantages of using Cassini instead of IIS on Vista/Win7?" because this is a game changer, ie on XP the best choice is IIS, but not it's not that clear of of choice on Win7
Eric Labashosky
A: 

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.

+1  A: 

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

Richard Szalay
+3  A: 

Looks like a 3rd option is coming soon: IIS Express.

Glen Little
A: 

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.

Yogendra