Dilshod K
Dilshod K

Reputation: 3032

Checking for any code updates Visual Studio 2019 and 2022

Sometimes (often) I am getting the message Checking for any code updates during debugging:

message

This makes productivity down. I did some research and find a post on the Visual Studio community: https://developercommunity.visualstudio.com/t/visual-studio-gets-stuck-looking-for-code-changes/1521675?viewtype=solutions

But the post was closed with Not Enough Info. It seems the person who posted that, doesn't know how to reproduce this. The same situation with me. I don't know why it is happening. Does anyone have this issue? How to solve this? It is happening in VS 2019 and 2022

Upvotes: 38

Views: 15590

Answers (7)

Yugraaj Sandhu
Yugraaj Sandhu

Reputation: 434

Simply click the arrow next to hot reload icon, then settings then uncheck the hot reload option.it works even for those who are unable to uncheck the option by going to tools->options->debugging...

enter image description here

Upvotes: 0

ABHISHEK Bandil
ABHISHEK Bandil

Reputation: 81

I solved it by unchecking the below option:

Tools-> Options-> Debugging > Enable Edit and Continue and Hot Reload

Upvotes: 1

UseCode
UseCode

Reputation: 1

I have the same issue and I try to solve this since over a year without sucess. Serveral try in option settings doesn't help. The issue starts with VS2017 Desktop Winform framework 4.6.1. Now I am using VS2019 also the virus scanner slow down continueing code change.

Now I realize that: 1 exeption occurs, which is caught by try catch (Output windows report-display only debug info).

after this exception is clear, the code likely to go on much more quicker. hope this can be help someone.

Upvotes: -1

David Bond
David Bond

Reputation: 308

I fixed this by closing all files except for the file(s) I am debugging.

I had a lot of files, including .razor and .razor.cs files open, so I expect that these were incorrectly being scanned for changes.

Upvotes: 0

anand
anand

Reputation: 632

I solved it by unchecking the below option:

Tools-> Options-> Debug > .NET/C+++ Hot Reload -> Enable Hot Reload and Edit and Continue when debugging

Hope it works.

Upvotes: 8

Krillegeddon
Krillegeddon

Reputation: 150

It just happened to me while writing an extremely long method. After a while, it started to take ages to do edit and continue. I split the method up to smaller chunks and then all is good again.

I managed to reproduce it afterwards and then it became slow again. I am using Visual Studio 2019.

Upvotes: 1

D.K
D.K

Reputation: 603

I had similar issues just like this, where continuing after hitting the breakpoint would constantly pop that up and delay the debugging sessions tremendously...

After hours of trying to figure this one out, I think I may have found the solution. I am not sure how your settings are, but this seemed to start happening with me when I started using .NET 6 on Visual Studio 2022 with these settings:

The settings that may affect this

When I turned them off and then restarted Visual Studio, the debugging session got much faster (and that pop-up only showed up once when the breakpoint was hit for the first time in that debugging session and for a very brief moment; afterward, it did not show). So you can give that a try.

However, if you are still experiencing issues with this even after turning these settings off, you might want to turn this setting off in Tools -> Options -> Debugging -> .NET/C++ Hot Reload: Another setting that probably affects this issue

I know turning this particular one probably may not be ideal (since Hot Reload with anything .NET is really useful and cool), but if your productivity is being dragged because of this, then I would suggest this.

Note that I am currently using Visual Studio 2022 with .NET 6.

UPDATE (2/18/2022): It seems that the update to Visual Studio 17.1.0 fixes this issue. I have not seen this popup come up after I upgraded to 17.1.0.

UPDATE (2/25/2022): After using VS 17.1.0 for a week, noticed that this issue persists if you have the Use previews of the .NET SDK turned on. Otherwise, it seems that turning Use previews of the .NET SDK off in Tools -> Options -> Environment -> Preview Features drastically lowers the loading time when Visual Studio is checking for the code changes or makes this Checking for any code updates pop up not show up. And it seems that the Rich Code Navigation feature does not really affect this issue at all.

UPDATE (3/7/2022): I've encountered this issue again and it seems to be happening in a very particular instance. So whenever I've hit a breakpoint and then make an edit and do Edit and Continue, it seems that the Hot Reload searches through the entire project to find any other changes (although the change was only done on one file and one line of code), thus taking longer time on a larger project which in turn bring up this Checking for any code updates popup while Hot Reload looks for changes to recompile. Thus, until the Visual Studio team addresses this performance issue among other things regarding the Hot Reload feature, I would advise turning off this feature if this issue is causing a huge delay in your ability to debug and work on your projects.

For editing Razor files (such as .cshtml or .razor) while you are running the app, I would suggest running it without debugging if you are only making changes to the views. This way you can still utilize Hot Reload while editing the view without encountering this problem.

Upvotes: 27

Related Questions