IIS on localhost is very slow

Check your web.config file for compilation mode. While you're developing, you should run your site in debug mode. If you're running in release mode, every aspx and ascx will be compiled into temporary assemblies, not only the pages and controls you hit. Also, set batch to false.

<configuration>
    <system.web>
         <compilation debug="true" batch="false" ...>
         ...
         </compilation>
    ...
    </system.web>
    ...

Of course, these are not recommended for production environments, which will be slowed down by these changes.


Also, check this forum thread, where you can find some interesting tips, like resetting the permissions of the ASP.NET temporary files folder:

I had the same problem and made all of the adjustments as mentioned in this forum but it didn't help. I began to suspect that the slow loading time of the dlls had to do with security settings. It appears that access to the dlls goes through security checking that is part of the operating system and not part of VIsual Studio. The dlls are located in a directory for your application under:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

In order to speed up the security checking, you need to remove all of the security settings on the root folder of your application in the above mentioned directory, or on the directory "Temporary ASP.NET Files" if you want to have it apply to all web applications you develop.

You right mouse click the folder and select Properties -> Security

Remove all users and groups. Some will not be allowed to be removed because they inherit their permissions from their parent folder. You must first remove the inheritance by clicking on the Advanced button and then uncheck the "Inherit from parent..." checkbox. Then remove the user or group. There must not be any users or groups where the checkboxes for their permissions are greyed out. If they are greyed out, it means that you didn't remove the inheritance from their parent.

After you have removed all users and groups from the folder, you then need to add the following users and groups:

Administrators Users ASPNET Network Network Service Local Service

Give each of these accounts full permission. Click on the Advanced button again and check off the "Replace permission entries on all child objects..."


This could be as simple as a DNS issue. Try using 127.0.0.1 instead of localhost when accessing. If this works, then just add a 127.0.0.1 to your hosts file and/or always access via your localhost IP.