I have a problem with my MVC application and startup.
Every time I make a change and one the app its take a long time to start up.
I have about 100 lines wit
You can control it from the Global.asax file by taking advantage of ViewEngines.Engines.Clear().
protected void Application_Start()
{
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new RazorViewEngine());
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterAuth();
}
It may help to check the following Debug options:
Tools > Options > Debugging > General
"Enable Just My Code"
"Enable .NET Framework Source Stepping"
"Source Server Support"
"Source Link Support"
"Use Managed Compatibility Mode"
"Enable Edit And Continue"
Tools > Options > Debugging > Symbols
"Load only specified modules"
"Specify included modules"
and disable allIIS Express should continue to run in the background while you change and compile your code. You can then go to Debug -> Attach Process and find the iisexpress.exe process and attach to it. The problem with hitting F5 every time is that VS tears down the process and restarts it which takes time.
I had this same problem, tested with VS2010 and VS2015. Symptom: VS was quick, compiled, loaded symbols and opened browser within a second but then browser just hung for 5 to 20 minutes. My projects are huge but my laptop is 16GB RAM, i7 and SSD so definitely not a size problem. I tried all the answers on this question and also here Visual Studio debugging/loading very slow.
In the end I found the solution here https://social.msdn.microsoft.com/Forums/en-US/394f3100-bac2-4b1c-8f8c-731226b905d4/painfully-slow-starting-a-web-application-in-visual-studio?forum=visualstudiogeneral
Exclude the directory "C:\Windows\Microsoft.NET\Framework" from antivirus scanning
Hopefully this will save someone else so much wasted time :)
I had the same problem with IIS Express 10, Visual Studio 2015 Update 3 on Windows 10. I did a few tests and with different settings and browsers (Chrome 54, Edge 38, Opera 41). The browser doesn't really matter, but I found three things which significantly changed my original 15 seconds load time:
So if you are willing to give up Edit and Continue, or even debugging then you can speed up the process.
Edit and Continue can be turned off in Visual Studio/Tools/Options/Debugging/General/Enable Edit and Continue.
You can start your project without debugging with Ctrl+F5.
I would not recommend to turn off your Windows Defender, but you can play around with its exclude directory function, you might win a few seconds there as well.
I found significant improvement after disabling logging.
Locate the IIS config for your project or machine, typically found in:
%userprofile%\documents\iisexpress\config\applicationhost.config
.\.vs\config\applicationhost.config
$(solutionDir)\.vs\{projectName}\config\applicationhost.config
And comment out or delete the following two nodes (found somewhere in the document)
<add name="HttpLoggingModule" image="%IIS_BIN%\loghttp.dll" />
<add name="HttpLoggingModule" lockItem="true" />