Debugging in Visual Studio 2012 is slow - asp.net

We have a large ASP.NET application that has been built over the last decade and is now running in .NET 4.0.
Recently, we upgraded to Visual Studio 2012 Premium (from 2010 Premium).
Our application compiles successfully, and when we run/debug our application its from a local IIS on each one of our developer workstations (versus using using the development server).
Ever since upgrading to 2012, when we are debugging our application, we have noticed the application to run VERY slow in loading ASP.NET pages, it can take nearly 20-30 seconds per page. But, when we access the application straight to the local IIS and without using the VS2012 debugger, it runs great. Something about debugging in Visual Studio 2012 on our application is slowing down our application performance significantly.
Is there a good tool we could use to capture what is going on in the background?
Also, this is happening on both Windows 7 Enterprise machines and Windows 8 Pro machines. All 64 bit with 8+ GB of RAM, and Intel Core i7 processors.
Thanks for any help.

My debug on VS 2012 was very slow, it was taking 20~30 seconds for every step.
My solution was disable the .NET Reflector extension.
Go to Tools - Extensions and Updates - Disable .NET Reflector.

Try to delete all breakpoints, then clean and rebuild solution and debug it again.

Maybe your application is throwing and catching lots of exceptions? This can really slow things down in debug mode. Set the Exceptions properties to break on CLR exceptions and see if this is the case.

Related

It is possible to debug an asp.net WebForms application on MacOS using Visual Studio 2022?

Current scenario is that I have this macos laptop (Apple M1 Pro processor) in which I was working for the last 8 months on react under visual studio code. Now, in a new project I need to leverage some API's and a lot of JSON responses and I wanted to debug the code but I saw that it is just not possible. I came across this old article ASP.NET Mono Setup
but I still feel that I won't be able to have the same level of developing experience like in a windows machine.
So, question is, can I (and if the answer if yes) debug an asp.net webforms app on visual studio 2022 for mac? If not, I would need to ask for a laptop replacement.
Thanks in advance!
Only the .net core runtimes are platform neutral.
But, the .net 2-4.8 runtimes are not.
One MIGHT be able to play and mess around with mono, but at the end of the day, I suggest you go with a VM (virtual machine),and run windows.
In other words, you don't need a new laptop, but just use a VM and install windows on that VM.

What would cause an AnyCPU web application to only work in 32 bit mode?

I have a .net mvc web application hosted on an IIS 7.5 web server. There are several dozen other applications on this web server, all in their own application pools. ALL application pools are 64bit and things have been working fine for some time.
Last night after making a few client side changes to the site in question I published and received the error, "Could not load file or assembly 'EntityFramework.DLL or one of it's dependencies. is not a valid Win32 application. See screen below.
I ran into this error several years ago and found that by switching my app pool in IIS to 'enable 32bit applications' fixed it. This time around however, I want to understand why this is happening. There should be no reason I can't run in 64bit mode.
I know the cause could be many things so I will just list some of things I have tried. Perhaps someone has an idea where to start.
In visual studio 2013 update 4 my application is set to build for 'AnyCPU'. I have tried building exclusively for 64bit and got the same error.
I am using EF 6.1.1 with data migrations
My web server is running windows server 2008 64bit w/ iis 7.5
My development machine runs windows 7 64bit and IIS 8 express. My app works fine in this environment
I do have references to other projects that reference EF. If their version is not consistent could this be a problem?
My application targets .net 4.5 and I have that version installed on my server.
The only changes I made to this commit from the last working one were some client side code and one new migration that involved adding a new nullable string/nvarchar property to a table.
I did update to visual studio 2013 update 4 between last commit and this one.
Any ideas? Thanks ahead.

Visual Studio -- On Windows Server 2008 R2 vs. Windows 7

I'm working on an ASP.NET project in Visual Studio 2010 remotely (over lan) on a very powerful windows server machine. I work for a small non-profit and the previous developer wrote and developed on this machine, so I came in and have been constricted to this setup. Visual Studio seems to run a bit slowly/choppy on this OS. I'm wondering if this is normal and if it is a better practice to develop locally on my Windows 7 machine.
Most developers I know run Visual Studio on their local machine. Everyone's case is different, so there's really no way for us to answer this question without actually being there. So do it, and see what works better for you. No one on SO can answer this for you.
I ran Server 2008 as a desktop OS on my previous machine for about 3 years - 4GB RAM, AMD CPU, had no problems developing with it so I don't think it's the OS per se, unless it's been installed or configured badly.
But no, that's not a normal scenario, it's never a good idea to do all the development on the production machine.
The slowness/choppiness could be a number of things: -
if the machine is being used to host the application you're developing, is the application actually in use while you're developing ? If the server is periodically or regularly under load, this could account for slowness
if the above is true, please tell me the actual ASP.NET website is a copy of the development codebase, and you're not just compiling the site in-place.. as it's being used.. the horror
is the machine doing anything else ? Is SQL Server also running on that machine, is it sending emails, are there some app-related windows services ?
have you tried profiling the application, or at least using PerfMon to see what's going on ?
any driver issues ? have you checked the eventlogs ?
how fast is your internet connection ?
In short it could be a number of things, but the development experience on Server 2008 should be no different from Vista, Win7 or 8.

Why is Azure deployment slower on Windows 2012 Server than on Windows 2008 Server

I have an ASP.NET (Webforms) working with .Net Framework 4.0.
If I deploy that site with osFamily="1" (on a Windows 2008 server) the .NET CLR takes 120 ms average (according to NewRelic logs).
If I take the exact site and I deploy it with osFamily="3" (on a Windows 2012 server) the .NET CLR takes more than 500 ms.
I know I should move to MVC4 and perhaps .Net Framework 4.5, but I would like to know if anyone else has had the same problem and if you know what could be causing this?
Edit
Looks like osFamily=2 also has the same problem.
From the forum discussion it seems that it's a known issue.
The issue is reported here.
Upgrading from VS2010 to VS2012, we noticed that deploying is very slow, which can be worked around but then stepping in code is very slow as well.
First, we thought it maybe the device but it is very slow even in the emulator. This machine we tested, is i7 processor with 12MB of RAM. This also seem the case for many who have reported on our forums.
Read more.
A solution seems to be the changing the driver to winusb (C:\Program Files\GHI Electronics\GHI Premium NETMF v4.2 SDK\USB Drivers\GHI_NETMF_WinUsb) - according to one of the comments.
http://social.msdn.microsoft.com/Forums/windowsazure/en-us/7cf664b0-5876-4d6a-b54d-fda46c544c6f/azure-deployment-slower-with-w2012-server-than-w2008-server-or-w2008-server-r2?forum=windowsazuretroubleshooting:
'I tried with .NET 4.5 with the same results. I think is something related to Azure SDK 1.7 & 2.0
Programmatically configure Azure cache client' Answer by Jordi Torra
It seems to be a problem with the Azure SDK 1.7 & 2.0.

ASP.Net Development Server performance

I am developing a simple ASP.Net application on a Windows 7 x64 machine using Visual Studio 2008 SP1. The computer itself is a very strong machine.
I am using the built in development server for debugging.
Starting the debug process takes a mindblowingly long time (~20 minutes until the first page is loaded). Sometimes the pages load immediately. I encounter this problem only with web projects, windows forms project work as expected.
What could be the cause? How can I make the development work like it worked on an XP machine?
Edit:
The web pages are normal pages, no heavy code, so this cannot be the reason.
try this fix for VS Studio 2008 http://support.microsoft.com/kb/946581
This fix was not included in Microsoft Update. It fixes slow build time and many more and is recommended for users that experience problems.
The main reason is probably because on each change of a page, there is a batch compile of a lot of files, on the same directory. To avoid the batch compile use this flag on the web.config. That way only the changed file will be compile, the one you work on it, and not others.
<compilation batch="false" ... >
Relative :
Slow Performance -- ASP .NET ASPNET_WP.EXE and CSC.EXE Running After Clicking Redirect Link

Resources