Deploying web applications can become a painful task if you have to check for a number of settings that you have to modify your code to make it work in production environment. There are chances that developers might miss something if there are a lot of deployment pushes. Features like debugging, tracing, error message display could be a big performance issue if they are turned "on" the production environment.
ASP.NEt 2.0 has a solution for this...and that is by adding on key to your machine.config
<configuration> <system.web> <deployment retail="true"/> </system.web></configuration>
Also, you can block download of specific file(for example.xps) types by registering those file extensions to HttpForbiddenHandler
<add path="*.asmx" verb="*" type= "System.Web.HttpForbiddenHandler" />
Continue reading here