By default a web project in VS is hosted by Cassini, the included web-server. Nevertheless I prefer IIS for my projects. For several reasons:
- Security. A site running in IIS is running under the asp.net account which is quite a stricter security context than the one Cassini is running in. This can lead to some unpleasant surprises when the app is taken to production. The issues would have popped up earlier when the app had been developed using IIS.
- Clearness of URL's. Especially when developing web services their consumers need clear url's . Using Cassini every service uses another port, by default this is random. In such a scenario it will be a puzzle to find out the url's of the services in a new round, or a round on another development machine. You can assign fixed ports to an app, but I don't think that's very clear.
- Security. When consuming a web service with a mobile app, or even from the emulator, you are crossing a network border. By default the firewall of your machine blocks the incoming request. Opening port 80 for "normal" web requests is doable, opening all the different ports Cassini is using will end in a nightmare.
Switching from Cassini to IIS is no big deal, there is a web property page in a web project. Switching smooth required a little more attention.
- Check "USE IIS Web server"
- Click "Create Virtual Directory"
- Click save. Now the somewhat enigmatic dialog shown in the screenshot pops up
- In the solution explorer refresh the web project
After the last two steps the new (service-consumer) projects will have the right url. In case you skip them they will use the old Cassini-type url.
This is no big deal but I would like to have IIS as a default. Without a doubt there is a setting for that but I just can't find it. Anyone?