Slow page refresh times during development - asp.net

We have a reasonably large ASP.NET MVC app that I work on in Visual Studio 2012 on Win 8. I have a strange issue with slow page load times after recompilation. Usually, the actual build time is about 5 seconds, then the browser opens up and it takes 1-2 minutes to load the page.
Some points:
It loads slowly whether I change a view or recompile the project completely
This is not a performance issue, everything else works really well, there is enough RAM etc.
It happens only with IIS Express. When I switch to the default development server, it works fine.
All the other devs in my team use IIS Express, but they do not have this problem.
I tried to re-install IIS and to use v7.5 instead of v8 and recreated all config files. No luck.
I tried to disable all extensions, obviously it didn't affect load times too.
There is nothing abnormal in Task Manager
It's a virtual machine on my Macbook Pro, but again – this is not a performance problem.
What else can I try?

Solved by turning off Windows Defender Service. Everything is a hundred times faster now.
UPDATE: I failed to find a reason why Windows Defender is using lots of CPU power pretty much all the time. I tried to google it and it turns out that many people have a similar problem on Win 8 with no good solution.
If you really want to leave Defender on, you can add the project folder path as an exception, but it still will be slow-ish.
Hope it helps someone.
UPDATE 2: The above still holds true in Windows 10. Especially if you're running it in a virtual machine (I run it in Parallels on Mac). The overall speed increase, not only page refresh times, is very noticeable.
UPDATE 3: Apparently Windows Defender has a habit of silently turning itself back on again. So, be wary of that.

After viewing this question and answer above I found that Windows Defender Service was already turned off for me, however, I was running AVG. I disabled AVG and sure enough the lag went completely away!
So if Windows Defender Service is turned off for you and you are running some sort of system protection like AV try disabling that.

Related

ASP.NET Visual Studio 2013 extremely slow debugging

I have an ASP.NET Application I want to debug on localhost. When I run it without debugging, it runs very fast and smoothly, with about 3 seconds per page load. However, when I try to debug the app with Visual Studio and Chrome or Firefox, every page load takes about 20-30 or even 40 seconds to load, which is extremely slow. I have tried everything I found on the internet about these issues, yet none seems to help me out:
"Load all Symbols" from Microsoft Symbol servers, then uncheck that location
Delete all breakpoints
Uncheck "Enable property evaluation"
Other options I can't recall
Which is a good debugging configuration for asp.net apps? Any extra suggestions that may help?
Thank you very much and kind regards,
David
It is possible that your visual studio is using a lot of memory. You should try to turn off the browserlink which will reduce the amount of memory being allocated. It is still fine to disable the browserling and the preview still works.
Here is a guide and explanation
http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx
It is also possible that you have a lot of data or calculation to be ran in your form load.
Another possibility is a slow internet connection, this only applies if you have items or scripts on your page the are from an external source like JavaScript, CSS etc.

Classic ASP site requests randomly hang in IIS7

I have a new IIS7 box running Windows Server 2008 Web Edition (x64), and I have set up an existing classic ASP site there. The site works fine and super speedy for the most part, but will randomly hang (about 1 out of 20 or so requests). By hanging, I mean I will click a page from the browser, and the browser (Crome on Mac) never responds -- it just continually loads until I finally get the following error after about 3 or so minutes:
Error 7 (net::ERR_TIMED_OUT): The operation timed out.
I'm pretty sure this is a Chrome-specific error, so I'm not too hung up on the actual error, but the cause of the time out. The site connects to a SQL 2005 server on the same network, but I'm pretty sure this isn't a SQL timeout, as that would happen within 30 seconds, and give me a specific error about SQL. I think this is an issue w/ my site, or the server.
Note that often after seeing this, I can simply stop the request and reload the page, and it will load just fine, super speedy again.
I'm not even sure where to begin troubleshooting this. I have to figure this out, otherwise this will mean a new server purchase down the drain.
Thanks in advance for any suggestions.
I've noticed a few more things about this problem. It'll happen more often after I've published files to the server (even static content like js or css files). It'll also happen occasionally on other sites running ASP.NET. Namely I've noticed the timeout on dotnetkicks.com which is also running IIS 7.5. Again, this only occurs in Chrome.
I've also tried uninstalling and re-installing Chrome but the problem continues. My next step is to try this from a couple different computers running Chrome outside my network.
UPDATE (April 29, 2011)
So I moved to Colorado a couple weeks ago and I haven't seen this problem occur even once since I moved. That leads me to conclude that 1.) my internet connection in Dallas was flaky and 2.) Chrome was less forgiving of a poor connection than other browsers. And of course, it basically rules out any possibility of there being a problem at the server's end.

Anyone realize success using Apple Mac OS 10.6 and Parallels 5 for a Visual Studio Dev machine?

Greetings my wonderful StackOverflow family :)
I grew up using Windows and switched to OSX as a Computer Science major in College. I've recently started my first real software developer job, and have a ThinkPad and Windows XP for developing ASP.NET / MS SQL applications (Visual Studio 2008).
Question:
Basically, I am wondering if any developers out there have had real success creating ASP.NET applications on a Mac using a VM? I've been fighting with Parallels 5 all week and finally have Windows 7 and VS 2008 running but my hot-keys are all screwed up. Is it worth the work to keep beating this thing into submission? Should I give up? Should I give Mono a try instead?
Thanks Folks, I can't wait to see what you all think!
I've been using Parallels versions 2/3/4/5 to do exactly this for some years now. #Brian - aside from problems arising from limited memory (I'd say 4GB minimum for this kind of thing) I've yet to encounter any issues. I develop .Net enterprise web apps using Visual Studio on a MacPro and also my 13" MBP) and can't imagine working on anything else in any other way :-)
Re: VMs vs Bootcam - using Bootcamp is an option if you absolutely have to squeeze the last 1-5% performance out of your box, but otherwise the benefit is minimal. Parallels will work with a bootcamp partition but has some drawbacks. For me the biggest pain was that Parallels VMs from a bootcamp part can't be suspended and resumed quickly and easily as ones running off an image file. Also, with image files you can keep a working clone of your VM ready to step in if your windows vm goes down. Its harder to keep a clone of a partition.
You can also give VM clones to colleagues so you're all working on identical environments. If your bootcamp partition goes down [and mine did many times during the Windows 7 beta days :-(] the road back to where you were is long and fraught. A lot of disk checking goes on and the bootloader is involved - can be nasty.
Just try it - you won't regret it. Its worth spending a bit of time setting up your keyboard. Personally I find this works very well with Windows 7: http://parkernet.com/applepro/ (its a mac->windows keyboard layout for Windows).
Hth.
I run Visual Studio on my MacBook Pro using VMWare and a Win 7 image. I havent had any issues. Havent tried ASP.NET development, but I assume its going to be fine since the IIS server or Cassini would be hosted on the VM.
The only issue I had was due to memory and maxing out my MacBook memory smoothed everything out.
You could try VMware Fusion or use Bootcamp instead.
I havent used Parallels for a while - and that has a reason.
[edit]
Parallels does support running a Windows on a Bootcamp Partition - as does VMWare Fusion.
I don't like the idea of doing development work on a VM.
Even if you manage to get it to work, little issues will crop up occasionally in the future.
Every time you encounter a difficult to resolve crash bug in your program, there will always be a nagging feeling that it's a VM-related bug.
You'll never get 100% performance in a VM.
You shouldn't need access to your Mac OS while doing work, and switching between the OSs is not that time consuming if you aren't constantly jumping back and forth between work and entertainment.
Just use bootcamp.
Note: I think Parallels supports running a VM fueled by a bootcamp-enabled windows, in a pinch.

Internet Explorer hanging when debugging ASP.NET app

This problem is beginning to annoy.
After my machine (Vista Ultimate) has been up for a while, running my ASP.NET web site project for debugging in VS2008 results in Internet Explorer "hanging". It doesn't seem to get past the network access stage, you know when it says "Loading web site", or "Waiting for".
I've attached a screenshot of IE. Note the status bar. It stays like that forever. I have to restart it and cross my fingers for it to work the next time. Invariably, it doesn't.
This happened with IE7 and IE8.
I am using the ASP.NET Web Development Server/Cassini. I have tried restarting this each time which seemed ot have got it, but then not so any more.
I'm up to date on patches.
ie screenshot http://img40.imageshack.us/img40/5446/iehanging.png
So thankfully Microsoft have finally released Security Essentials.
This meant I could de-install AVG (Free and paid-for versions) from my machine.
Hey presto, it works!
I would check the following
1) that your not starting IE against the webserver againt the wrong port, if your using the development IIS then it changes ports at times. That combined with you setting up the browser to launch against a the old port could create this problem.
2) Stop the local IIS and restart it (Again make sure your pointing towards the correct port)
3) Make sure you dont have any hung IE in task manager ( this happens to me sometimes ). Basiclly you have a IE in task manager that uses less then 1mb of ram and does not show on the taskbar, if thats the case kill them.
This doesn't sound, strictly speaking, like a hang. Can that tab/other tabs be navigated to other sites? Is your machine configured to use a proxy?
Is the request actually sent? Using Fiddler2 from www.fiddler2.com with the URL http://ipv4.fiddler:56125/ will show you, and help determine where in IE the problem might be.
I just had a similar problem that took about a week to unravel. Using AVG 9 Business Edition.
I'm on a Windows 7 machine with Visual Studio 2010 SP1, debugging ASP.NET sites running in IIS, with the same "hang" behavior you're seeing. Disabling LinkScanner and Online Shield in AVG fixed the problem.

IIS7 slow appPool startup compared to IIS6

I have recently purchased some new windows server 2008 boxes all running IIS7.
I have moved some of my websites across to them, but they seem to be running VERY slow when the app pool first kicks in.
All the sites are precompiled (using webdeploy) and in IIS6 they were lightening fast, I thought it might have been just because the web apps are fairly large but I get the same issue on smaller ones too.
The app pools are set to Classic mode, as we couldnt get the urlMapping to work in integrated mode.
I have seen a few posts about the slowness on the net and one post on here about it and people throwing stupid answers around such as its because your code isnt compiled or its to do with JIT, and both answers are pretty much a word that rhymes with JIT but has an extra letter. I say this because I have run much larger web apps in IIS6 and not experienced this lag.
Thanks for anything that you bring to the table on this.
edit:
just done some timings and it can take up to 28seconds for the first request to return a page...
This was slow due to using Classic Mode, I have moved it to integrated pipes which is faster at around 9 seconds load time, which is still unacceptable, but I believe this is an application issue now not IIS.

Resources