This is really short post, more a tip.
If you need to determine if your application is running in IIS or Developer Web Server (Cassini) that comes with Visual Studio, you can test the process name you are running in. For example, the following code:
will return the name of the running process. In case of developer web server in Visual Studio 2010 it returns
"C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.exe"
So, if you for example want to scan Bin folder, code that you run in IIS will not work running in Cassini. This simple one line of code will let you know what you are running.