views:

66

answers:

1

I am taking some time to learn how to develop asp.net mvc2 websites, but I'm used to working directly off IIS instead of the built-in web server that uses the random ports when you hit F5.

but I've noticed that using the built-in webserver, requests fly and are immediate. I am using only the default project with the Home and About pages as it comes out of the New ASP.NET MVC 2 Project settings, no database connections, nothing beyond the base install...

but when I setup the IIS website and pointed it to the same directory, each request takes at least 3-5 seconds to complete, sometimes more.

this isn't just the "load" on the first request. EVERY request takes this long on IIS.

but if I F5 and test the project once again, everything zips and the responses are immediate.

What might i have configured incorrectly?

this is on win7 x64 by the way

+1  A: 
  1. You can check with a tool like firebug what takes the longest time in the request. If you use firebug it will tell you which part of the request cycles takes a certain amount of time. (I once used this when I encountered problems with the localhost URL, Firebug told me that the DNS request took about 2 seconds while using 127.0.0.1 took 1ms (using google I found out that was an issue due to ipv6 enabled)). So try tracing the requests with Firebug.

  2. If the request to IIS is performed quite fast and the browser is waiting for a response for a long time it must be in the handling of IIS (the built-in server and IIS are different). In that case you can try reinstalling IIS (to make sure no plugins or other data is in IIS making the site slower) by removing and adding IIS via the windows components.

  3. If that still doesn't solve the problem try tracing on the application via the built-in tracing capabilities of ASP.NET (http://msdn.microsoft.com/en-us/library/wwh16c6c.aspx)

Gertjan
Problem was the website in IIS, but I didn't have to reinstall IIS, I just readded a new website for it in IIS and it worked like a charm.THANKS AGAIN!
Josh
okay it turns out that this didn't work after all... it's running even slower on IIS now! but hitting f5 and using the dev server it just ZIPS!this is ridiculous! it's not IIS as a whole because I have a regular asp.net 2.0 site running on the same server, the same IP address just different host header, that one works just as quickly!why is this so difficult? I don't want to use the built in server I want to use IIS!!
Josh
@Josh, is it slow on all requests? Or only the first one? IIS needs some time to compile. What is exactly slow? Try using the tracing.axd in .NET to see what takes so long. Maybe there is something in you machine.config or "global" web.config which might not be loaded in the built-in webserver.
Gertjan
all requests are slow, and this is a plain jane installation, NOTHING in there but the bare essentials of a new blank asp.net mvc site...I eventually gave up and removed EVERYTHING, all the sites, all the app pools, and readded them again with new names. seems to be working now, will report back if that changes, thanks!
Josh
incidentally it doesnt appear to be happening on images, just pages... this is nuts I'm wasting so much time on this ridiculous problem!!
Josh
I really think you should go tracing in this case. Somehow something in IIS is waiting for input. Maybe a session handler in the database or something. Other possibility is that your ASP.NET worker process is recycled to early. Creation of the worker process takes some while (just like the first compile of an ASP.NET application).
Gertjan