Please check below the list of things I've tried before closing as duplicate.
The problem:
I've been struggling with this problem since yesterday, I read every post/article I could found about this with no luck. Though, I have to admit that I'm new to ASP.NET and web development in general and not familiar with the IIS configuration so I might've missed something.
The things I've tried:
Disabled antivirus and firewall.
Disabled IPv6 by commenting the ::1 localhost
line in the hosts file. My hosts file looks like this:
127.0.0.1 localhost
# ::1 localhost
Tried different browsers.
Changed the port of the application URL.
Changed the application URL from localhost:port
to 127.0.0.1:port
but when I do so, I get:
Bad Request - Invalid Hostname
Uninstalled and reinstalled IIS Express (tried multiple versions: 7.5, 8.0, and 10.0).
Tried installing the "Application Development Features" under Internet Information Services\World Wide Web Services
.
Launched the VS installer and run a repair.
Environment information:
Any idea what could be causing this problem?
I just tried using Jexus Manager. Loaded the configuration from the .sln file as shown here, started the website and tried the following scenarios:
There are lots of things happening when you fire up Asp.Net MVC app for the first time, so I cannot pinpoint exactly one thing that could be causing a bottleneck but try following suggestions which might help you to improve startup time for your web app:
System.Web\compilation
has debug=false
Application_Start
method in Global.asax.cs
file to remove unnecessary callsI hope this will give your app some boost during start up.
This can be for the following reasons:
There is a well disguised option called Idle Time-out Action which can be changed on the advanced settings of the application pool. The time-out operation is by default set to Terminate, which means that the Windows process hosting the site will be terminated. If this termination happens, the site must be built and the process started on the next visit, resulting in a very slow first-time load.
If you are running a dedicated server for just your service or a small number of sites, then its obviously cramping your style. Setting it to 0 is the way to go in those cases. Other argue that 1740 minutes. Why? it’s the smallest prime number (in hours) over 24.
for changing the Idle Time-out Action to 0 on a Microsoft Windows Server 2012 R2, Access the IIS and Select the Application Pool serving your site and select Advanced Settings in the menu to the right, Locate the Idle Time-Out (minutes) option, Change it to 0 and press OK.
Another possible solution: install the IIS feature Application Initialization. Then it should work with this configuration:
True
on the website level.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With