In my Visual Studio instance, even if I just wrote a single line of return in a C# console application, it will take me a minute after pressing F5 to execute the actual code (I mean the time it takes to stop on the single return statement after pressing F5 -- I set a breakpoint on the return statement in the main function). What is wrong? Is there a check list?
I am using Visual Studio 2008 VSTS edition and debugging on Windows Server 2003 x64.
You may need to delete all your breakpoints---note that you need to click the "Delete all breakpoints" button (or use Ctrl + Shift + F9), NOT just delete them one by one. If Visual Studio has mangled your solution settings the latter will not work. You may need to add a breakpoint first, in order for this to work (clever, eh?).
If worst comes to worst, you may need to delete your .suo file and let Visual Studio start a new one from scratch. Note that you will lose your personal solution configuration settings, however (only for this solution, not any others). However, you may want to move/rename the file temporarily until you determine whether or not this is the problem; that way, you can always move it back. I have seen some online resources recommend deleting (moving/renaming) the .ncb file as well.
I have seen this before. Try deleting all your breakpoints and then set the ones you want. Hit F5. Is it faster now?
I just noticed that you mentioned setting up the .NET source debugging feature. Try to disable that. Your network connectivity to Microsoft's source server may be slow. Also disable any symbol server connectivity in menu Tools → Options → Debugging → Symbols.
Also try disabling "Enable property evaluation and other implicit function calls" in menu Tools → Options → Debugging → General.
Or remove your .suo file which can be found next to your solution (.sln) file.
This solved an issue I had with debug sessions taking a long time to start and stop.
I had this problem. After trying all the listed advice and removing all Visual Studio extensions, we finally figured out that somehow IntelliTrace was enabled. Disabling that fixed everything.
How to: Enable and Disable IntelliTrace
Do you have a lot of breakpoints set? Those can really slow down startup time. Everytime a new module is loaded into the process address space, they all need to be checked to see if they are valid.
Go to menu Tools → Options → Debugger → Symbols and check if you have public symbols set or UNC network paths set. Also check menu Tools* → Options → Debugger → General to see if you have source server set.
All of these can affect debugging based on slow network speed or unavailable servers. The 5 minute wait time is network timeouts.
If nothing in options is set, check to see if you have the _NT_SYMBOL_PATH environment variable set.
My colleague had a very slowly responding Visual Studio, and it literally took minutes to perform a step while debugging.
The root cause turned out to be an anti virus program (Threatfire) that went crazy while Visual Studio was running. Killing its process immediately fixed everything.
In my case changing the debug symbol "Automatically load symbol for" option from "All modules" to "Only specified modules" solved the problem. You can change this option from menu Tools → Options → Debugging → Symbols.
A different cause plus... How to find the problem
To me it was the option ShowOtherThreadIpMarkers. A value of 1 makes Visual Studio (2010) unbearably slow (3-5 seconds for each debug step. With a value of 0, it is fast again.
What is it that option? I have no idea. I could not find it through the Visual Studio user interface.
I unchecked all possible debugging options in there and nothing worked.
So I went to Import/Export Settings and loaded my old settings I've previously saved going backward in time until Visual Studio was fast again, then compared the vssettings files..., etc., etc.
I'd like to remark that if you load the settings while you are in debug mode stopped on a breakpoint, they become effective immediately. You don't have to stop the debugger and restart.
From ScottGu's blog linked by Travis: "One other performance gotcha I've heard about recently is an issue that a few people have reported running into with the Google Toolbar add-in. For some reason this can sometimes cause long delays when attaching the Visual Studio debugger to the browser. If you are seeing long delays with your web application loading, and have the Google Toolbar (or other toolbars) installed, you might want to try uninstalling them to see if that is the cause of the issue."
Running under the debugger for me was roughly 10x slower than running without debugging.
After trying every solution suggested here, I went through every debugger setting and enabled/disabled to see if it made a difference.
For me, it turned out that disabling Suppress JIT optimization on module load in the debug settings massively improved things.
Make sure you don't have any stale network mappings to servers that no longer exist (network timeouts will kill you). Or use something like Process Monitor to see if a network (or other file error) seems to be blocking for a long time.
Are you using a symbolsServer to download symbols for Windows DLL files?
If so, disable that as it can take some time, but I wouldn't expect that to cause long delays in a basic console application.
Menu Tools → Options → Debugging → Symbols.
I know this is an old topic, but for what it's worth...
I've found that if I've had a separate Internet Explorer window open for a long time it can take up to a minute to start debugging. Close all Internet Explorer windows and debugging starts immediately.
In my case Google Toolbar was slowing down my debugging.
gplus_notifications_gadget.html just kept going on and on overloading the debugger. I wanted to keep the Google Toolbar because I use it on a regular basis, so I just disabled the G+ notification button (the small button besides the profile button). It is happy now.
I had the same issue in Visual Studio 2010, with stepping in the code excruciatingly slow (between 3 to 10 seconds). However, none of the above settings modification did the trick.
I eventually found the ultimate solution, which would work in all of the above post issues: reset all your settings, as described here (essentially menu Tools → Import and Export Settings, Reset all settings, with saving existing settings to a file (for reverting)).
You may first want to save a particular part of your settings. For instance, I first saved my color theme (Solarized-like) and then restored it after the global reset.
For me, the setting that killed performance (Windows 8 even hanged except for mouse movement) was to uncheck "Break all processes when one process breaks" in menu Options → Debugging → General.
Just one more cause of a slow Visual Studio debugging experience...
Long time ago I enabled FusionLog to see what was causing an assembly binding problem.
Make sure you disable it after using it. Why? Because it writes a lot of logging data to the disk while enabled.
This is the FusionLog key on Window's Registry (regedit.exe):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Change the ForceLog, LogImmersive and LogResourseBindings values from 1 (enabled) to 0 (disabled).
I had this problem too, but it had nothing to do with breakpoints in my case. It was code shortcuts that I added in the tasks window:
http://www.customsoftwareframeworks.com/blog/longwaittimetoinsertoraddalineoftextbuginvisualstudio--tasklistwindow--onlywhenaddingandremovelines
I'm sure there are other ways you could see a problem like this, but there is a bug somewhere that caused this problem for me...deleting all my options would have fixed this, but that is something that I did not want to do. So, I debugged it and wrote about it in my blog...your problem sounds like mine.
Something that has worked for me is to make sure there are no conditional break points. Other than that, I have had success fixing slow debugging by simply restarting Visual Studio and only opening one instance of Visual Studio at a time.
I had a similar issue and none of the other guidance seemed to help. I had rebooted to no avail. I had removed all breakpoints, deleted the .suo file, checked that symbols weren't being loaded from external sources, and checked that no paths existed in the application that was unavailable.
Then, I thought to clean the solution. I noticed in the output window that C# IntelliSense reported an issue when cleaning:
There was a problem reading metadata
from
'{B0C3592F-F0D1-4B79-BE20-3AD610B07C23}'
('The system cannot find the file
specified.'). IntelliSense may not
work properly until the solution is
reloaded.
In this case, once you actually discover the error message, it tells you exactly how to resolve it. (Good job on the error text, poor job on discoverability!) I unloaded the solution's projects, then reloaded them. I was then able to successfully run clean solution. It worked, and the debugger did as well.
Closing the "Autos" window improved debugging for me in Visual Studio 2008 for a big native C++ solution.
Hiding it won't work. It needs to be closed.
I experienced the same slowdown and disconnecting from the network fixed the problem for me as some other comments and answers have stated (but of course that is not an ideal fix).
For my case this one simple change fixed my solution: In the project properties on the debug tab I disabled "Enable the Visual Studio hosting process" (I am running Visual Studio 2010).
Get more memory and a faster HD. More details are here.
Related
I have a problem with my computer : windows 7-64, freshly and cleanly reinstalled.
When I develop on Visual Studio 2010 Ultimate SP1, once the application is built, it runs twice.
Let me explain.
If I double clic on it in the folder, the console application runs, block for a few seconds (depending of the complexity of the program), then closes, the re-opens, runs and is stable.
If I launch it in a console, another console opens (like a pop up), runs the program, closes, then the program is executed in the first console.
If I launch it in debut with a break point, the application opens in a first console, executes without stopping, then closes, the relaunch in another console, et stop at the break point.
However, if I try other command non related to Visual Studio built (as firefox ...) I don't have this problem.
I've tried with a simple "Hello World" or with much more complex program, and I always get the same result.
Does anyone have already seen this kind of thing or now where to dig ?
Thank you.
Grégoire
I've had this same problem recently, mine was solved by disabling Avast DeepScreen (if you use avast go into settings -> antivirus -> un-check DeepScreen). Hope that helps.
They updated the settings page, you now have to uncheck CyperCapture under the 'General' tab.
Alternative you can add your program to 'Exclusions'.
Updating Neller's answer. In my case it was also Avast, but today the option you need to disable is called "Cyber Capture"
Press the Hamburger to open the menu => Settings => Protection tab => Core Shields => uncheck "Enable CyberCapture"
To expnad Neller's answer, this behaviour is common in various Antivirus Systems. More precisely I have come across it both on AVG and Avast.
To avoid this behaviour you can simply add a folder scan exception regarding Visual Studio Folder.
e.g for AVG:
Mennu -> Settings -> Exceptions -> Add:
C:\Program Files (x86)\Microsoft Visual Studio 12.0*
In VS 2010, after I would close my solution, and then re-open it the next day, all the documents that I had open, would still be open. Just what I wanted.
After installing SP1, every time I open my solution, all my documents are closed, no matter what state I left them in.
Is this expected behavior, a bug, or is there a setting I don't know about? How can I get my documents back?
EDIT 29-Mar
Re-installing VS2010 and SP1 did not resolve this issue.
Building on top of SteveBob's answer, just do a Window -> Reset Window Layout
This should fix the tab problem. There is of course the side-effect that you'll have to redo/re-add all the windows ( output, solution explorer, properties, find, watches, immediate, etc)
Backup your settings then do a devenv.exe /resetsettings.
It appears that there is not an adjustable setting that controls whether or not the open documents are remembered. By default, Visual Studio stores this data and then re-opens the documents that were open the last time the project/solution was closed. As pointed out by some links referenced by Stuart Dunkeld, it takes a Macro in Visual Studio to override this default behavior.
My problem appears to be that my 'Settings' had become bloated/corrupt. Based on the suggestion of Luke, I exported my settings, then did a reset. This restored the default 'Remember Open Documents' behavior. Then after much fooling around, I was able to import (almost) all of my old settings and still not mess up the proper document behavior.
When importing my settings, I selected everything except the 'Window Layouts' settings.
This restored my existing settings, while keeping the default Visual Studio behavior of remembering which documents were open.
I then re-exported my (fixed) settings so that I had a backup. That's when I noticed that my old, possibly corrupt exported settings file was 8.6MB, while my new, correct exported settings file was only 0.2MB.
After examining some of the differences between these two settings files, some of the information leads me to believe that the installation of VS2010 SP1 had a conflict with the 'Document Well 2010 Plus' feature in the Productivity Power Tools extension, but I cannot positively verify this.
Does it work OK with a new solution? If so, you could try trashing the .suo file attached to your solution.
I keep a lot of files open. Every so often, my VS2012 stops restoring the open files. Opening them again does not help the restore process.
I tried:
All the above suggestions, and all the suggestions I could find elsewhere
In particular: deleting .suo, .filters, .sdf, .opensdf, etc
Plus /resetlayout
Plus /resetsettings(ouch)
And none work for me. Or, at least not reliably.
But I just tried:
Install Productivity Power Tools
Enable Options / Productivity Power Tools / All Extensions / Custom Document Well
Restart Visual Studio
(the PPTools document well saves and restores properly!)
Disable Options / Productivity Power Tools / All Extensions / Custom Document Well
Restart Visual Studio
And now the builtin document well has resumed saving and restoring properly as well! At least for the moment.
I'm guessing that the builtin "document well" was derived from the one in PPTools, possibly causing the side effect of turning the PPTools on and off.
(I could simply use the PPTools document well all the time. But I can't get the colors therein to work to my satisfaction.)
Hope this helps someone.
Have you tried deleting the .suo file? It may have become corrupted.
I'm working on a ColdFusion project for a while now, and Visual Studio started to behave strange for me at least.
I observed that when I started debugging, it built the project, it started the deploy, and the deploy finished and it was starting to load symbols for my project.
But it was very slow, and I don't know why it started to do this step. What may I have done?
Is this symbol loading step necessary? How can I disable it?
In the Tools -> Options -> Debugging -> Symbols dialog there is no Symbol file (.pdb) location added. And I pointed in my project's debug directory at the field below, and I checked the "Search the above directory only when symbols are ...." checkbox. How should I set up this dialog to turn off symbol loading?
I looked in the Modules window which symbols are loaded, but it says nothing to me. What is the problem?
Debug -> Delete All Breakpoints ( http://darrinbishop.com/blog/2010/06/sharepoint-2010-hangs-after-visual-studio-2010-f5-debugging )
After that you can use them again, but do it once. It will remove some kind of "invalid" breakpoints too and then loading symbols will be fast again. I was chasing this issue for days :(.
Another reason for slow loading is if you have disabled "Enable Just My Code" in Debugging options. To enable this go to:
Tools -> Options -> Debugging -> General -> Enable Just My Code (Managed Only)
Make sure this is checked.
Just had this problem.
I fixed it by navigating to:
Tools -> Options -> Debugging -> Symbols
Then unchecking all non-local sources for Symbol file (.pdb) locations
e.g. Microsoft Symbol Servers and msdl.microsoft.com/download/symbols
Configure in Tools, Options, Debugging, Symbols.
You can watch the output window (view, output) to see what it's doing usually. If it's really slow that probably means it's hitting a symbol server, probably Microsoft's, to download missing symbols. This takes three HTTP hits for each file it can't find on every startup - you can sometimes see this in the status bar at the bottom or in e.g. Fiddler. You can see which modules have loaded symbols in Debug, Windows, Modules whilst you're debugging.
Symbols mean you get useful stack trace information into third party and system assemblies. You definitely need them for your own code, but I think those get loaded regardless. Your best bet is to turn off any non-local symbol sources in that menu and, if you're loading lots of symbols for system assemblies that you don't need to debug into you can temporarily disable loading those to speed up debug start - but they're often useful to have loaded.
I faced a similar problem. In my case I had set _NT_SYMBOL_PATH to download from Microsoft Servers for use in WinDbg and it looks like when set, Visual Studio will use that with no way to ignore it. Removing that environment variable resolved my issue.
You can try the following answer to Visual Studio debugging/loading very slow:
Go to Tools -> Options -> Debugging -> General
CHECK the checkmark next to "Enable Just My Code".
Go to Tools -> Options -> Debugging -> Symbols
Click on the "..." button and create/select a new folder somewhere on your local computer to store cached symbols. I named mine "Symbol caching" and put it in Documents -> Visual Studio 2012.
Click on "Load all symbols" and wait for the symbols to be downloaded from Microsoft's servers, which may take a while. Note that Load all symbols button is only available while debugging.
UNCHECK the checkmark next to "Microsoft Symbol Servers" to prevent Visual Studio from remotely querying the Microsoft servers.
Click "OK".
Also try to delete all the breakpoints(Debug>Delete all the breakpoints),
See Also: Visual Studio 2015 RC1 Hangs in Debug mode while loading symbols
For me, it seems related to breakpoints, as indicated in the accepted answer. However, I found two workarounds that did not involve deleting all the breakpoints:
Restarting Visual Studio seemed to fix it temporarily.
Clicking the "X" button to close Visual Studio while debugging causes the "Do you want to stop debugging?" message box to pop up; while this message box is up, the symbols load at ordinary speeds. Once all the symbols are loaded, you can click "No" to cancel the close.
Just encountered this issue.
Deleting breakpoints didn't work, or at least not just on its own.
After this failed I Went Tools > Options > Debugging > Symbols and "Empty Symbol Cache"
and then cleaned the solution and rebuilt.
Now seems to be working correctly. So if you try all the other things listed, and it still makes no differnce, these additional bits of info may help...
Visual Studio 2017 Debug symbol "speed-up" options, assuming you haven't gone crazy on option-customization already:
At Tools -> Options -> Debugging -> Symbols
a. Enable the "Microsoft Symbol Server" option
b. Click "Empty Symbol Cache"
c. Set your symbol cache to an easy to find spot, like C:\dbg_symbols or %USERPROFILE%\dbg_symbols
After re-running Debug, let it load all the symbols once, from start-to-end, or as much as reasonably possible.
1A and 2 are the most important steps. 1B and 1C are just helpful changes to help you keep track of your symbols.
After your app has loaded all the symbols at least once and debugging didn't prematurely terminate, those symbols should be quickly loaded the next time debug runs.
I've noticed that if I cancel a debug-run, I have to reload those symbols, as I'm guessing they're "cleaned" up if newly introduced and suddenly cancelled. I understand the core rationale for that kind of flow, but in this case it seems poorly thought out.
In my case Visual Studio was looking for 3rd-party PDBs in paths that, on my machine, referenced an optical drive. Without a disc in the tray it took about Windows about ~30 to fail, which in turn slowed down Visual Studio as it tried to load the PDBs from that location. More detail is available in my complete answer here: https://stackoverflow.com/a/17457581/85196
I had the same problem and even after turning the symbol loading off, the module loading in Visual Studio was terribly slow.
The solution was to turn off the antivirus software (in my case NOD32) or better yet, to add exceptions to it so that it ignores the paths from which your process is loading assemblies (in my case it is the GAC folder and the Temporary ASP.NET Files folder).
My 2 cents,
I was having a similar problem while trying to get a (Visual Studio 2013) Diagnostics Report in x64 Release Mode (CPU Sampling) and while the symbols for the needed dll files were loaded, the symbols for my executable would fail to load.
I didn't change anything in the Symbols menu, I instead made some changes within the Property Pages of my executable's thread in the Solution Explorer, namely
Configuration Properties / General / Enable Managed Incremental Build to YES
Configuration Properties / Debugging / Merge Environment to NO
Configuration Properties / C/C++ / Enable Browse Information to YES (/FR)
Configuration Properties / Linker / Enable Incremental Linking to YES (/INCREMENTAL)
EDIT : This last one does the trick
....
Configuration Properties / Linker / Debugging / Generate Debug Info to Yes (/DEBUG)
....
After that it worked and it loaded the symbols fine.
I'm sure one or more of the above did the trick for me (although I'm not sure exactly which) and just want to let others know and try this..
peace
Try right clicking at one of the breakpoints, and then choose 'Location'. Then check the check box 'Allow the source code to different from the original version'
Unchecking "Enable JavaScript debugging for ASP.NET (Chrome and IE)" in Tools->Options->Debugging->General resolved my case with unavailability to launch VS2017 debugger with pre-set breakpoints.
The only thing that worked for me was changing the code type.
In the Attach to Process window, I changed the Attach to: selection to Automatically determine the type of code to debug, then my breakpoints were hit.
I previously had only Native code selected.
goto project properties -> debug -> uncheck enable native code debugging
I had a similar issue where visual studio keeps loading symbol and got stuck.
It turns out I added some "Command line arguments" in the Debug options, and one of the parameters is invalid(I am supposed to pass in some values).
After I remove the extra parameter, it starts working again.
Even if I create a clean WinForms project, Edit and Continue doesn't work and gives me the error:
Changes are not allowed when the debugger has been attached to an already running process or the code being debugged was optimized at build or run time.
Edit and Continue option is checked in Tools → Options → Debugging.
Optimization is not enabled.
Seems like there is no any managed profiler set up.
I am running in Debug mode
I am running on x64 CPU and Windows XP 32-bit, but setting platform target to x86 rather than AnyCpu doesn't help.
Repairing Visual Studio installation doesn't help.
I also found this article on MSDN website:
Unsupported Scenarios
Edit and Continue is not available in the following debugging scenarios:
Debugging on Windows 98.
Mixed-mode (native/managed) debugging.
SQL debugging.
Debugging a Dr. Watson dump.
Editing code after an unhandled exception, when the "Unwind the call stack on unhandled exceptions" option is not selected.
Debugging an embedded runtime application.
Debugging an application with Attach to rather than running the application with Start from the Debug menu.
Debugging optimized code.
Debugging managed code when the target is a 64-bit application. If you want to use Edit and Continue, you must set the target to x86. (Project Properties, Compile tab, Advanced Compiler setting.).
Debugging an old version of your code after a new version failed to build due to build errors.
But I can answer "No" to every item in this list.
It worked before, but several days ago it stopped working, and I don't know what could be the reason.
Other Applicable Solutions:
Below is an incomplete, unordered list of possible solutions to try if you* are trying to fix Edit & Continue quickly.
Make sure you are in Debug Mode
Make sure you're not launching a mixed mode process
Try to set the CPU target to x86 rather than AnyCPU (on x64 machines)
Uncheck the Optimize Code checkbox for Debug Mode in Project Properties->Debug
Uncheck the Optimize Code checkbox in Project Properties->Build
Uncheck Enable Optimizations in Advanced Compiler Settings
(ASP.NET) Check nightcoder's answer if it is the case
(ASP.NET) Check this answer (by matrixugly) if it is the case
(ASP.NET) Ensure you have Edit and Continue enabled on the Web tab (vs2010)
(ASP.NET) Go to Properties > Web > Servers, and make sure that Enable and continue is checked under Use Visual Studio Development Server.
(ASP.NET WebAPI) Make sure you've stopped in the Controller's method using a breakpoint, before trying to edit it.
(vs2017) Go to Tools > Options > Debugging and uncheck (deselect) 'Edit and Continue'. This is actually the opposite of the 'conventional' advice (see some other points in this post). It does not allow you to actually make changes in your running program (i.e. it does not hot-swap the code changes that you make) - it simply allows you to edit your code (i.e. it prevents that annoying message and "locking" your editor).
Go to Tools > Options > Debugging > General and make sure Require source files to exactly match the original version is unchecked.
Check Enable Windows debug heap allocator (Native only) [VS Community 2017]
Are you using Microsoft Fakes? It inhibits Edit & Continue.
Kill all the *.vshost.exe instances by selecting End Process Tree in the Task Manager. VS will regenerate a correct instance.
Remove all the breakpoints with Debug->Delete All Breakpoints
Enable and Continue exists in both the Tools > Options > Debugging menu and also in the Project Settings. Be sure to check both places. edit & Continue is not supported with the extended Intellitrace setting.
Be sure Debug Info in Project Properties > Build > Advanced > Output > Debug Info is set to Full
Some plugin may be interfering. Check by disabling/uninstalling and then trying again the other solutions.
If you're not paying enough attention, the error you get while trying to fix this may change to something else that is easier to diagnose. E.g. A method containing a lambda expression cannot support edit and continue.
Make sure the System variable COR_ENABLE_PROFILING is not set to 1. Some profilers set this when installing and leave it like that after uninstalling. Open a command prompt and type set to quickly check it your system is affected, if so remove the variable or set it to 0:
In Windows 8 and above, search for System (Control Panel).
Click the Advanced system settings link.
Click Environment Variables.
Remove COR_ENABLE_PROFILING
Be aware of unsupported scenarios (as reported in the question) and that unsupported edits.
* by 'you', I mean the visitor of the page who is hammering his head on a keyboard to find The solution.
Feel free to edit this answer to add your workaround if not listed here!
If you're debugging an ASP.NET application, go to properties > web > Servers, and make sure that "enable and continue" is checked under Use Visual Studio Development Server.
I finally got to solve the problem: UNINSTALL Gallio
Gallio seems to have quite some many rough edges and it's better to not use MbUnit 3.0 but use the MbUnit 2.0 framework but use the gallio runner, that you are running without installing from the installer (which also installed a visual studio plugin).
Incidentally, I had the issue even after "disabling" he Gallio plugin. Only the uninstall solved the problem.
PS. Edited by nightcoder:
In my case disabling TypeMock Isolator (mocking framework) finally helped! Edit & Continue now works!!!
Here is the answer from TypeMock support:
After looking further into the edit
and continue issue, and conversing
about it with Microsoft, we reached
the conclusion it cannot be resolved
for Isolator. Isolator implements a
CLR profiler, and according to our
research, once a CLR profiler is
enabled and attached, edit and
continue is automatically disabled.
I'm sorry to say this is no longer
considered a bug, but rather a
limitation of Isolator.
I had the same problem. I even re-installed VS 2008 but the problem did not go away. However, when I deleted all the break points then it started to work.
Debug->Delete All Breakpoints
I think it was happening because I had deleted an aspx page that had break points in its code, and then I created another page with the same name. This probably confused the VS 2008.
"Edit and Continue", when enabled, will only allow you to edit code when it is in break-mode: e.g. by having the execution paused by an exception or by hitting a breakpoint.
This implies you can't edit the code when the execution isn't paused! When it comes to debugging (ASP.NET) web projects, this is very unintuitive, as you would often want to make changes between requests. At this time, the code your (probably) debugging isn't running, but it isn't paused either!
To solve this, you can click "Break all" (or press Ctrl+Alt+Break). Alternatively, set a breakpoint somewhere (e.g. in your Page_Load event), then reload the page so the execution pauses when it hits the breakpoint, and now you can edit code. Even code in .cs files.
Couple of things to check
Make sure your compile is set to Debug vs. Release
Make sure you're not launching a mixed mode process
If on a 64 bit machine Make sure to set the CPU target to x86 rather than AnyCPU
EDIT
I don't believe this should matter but make sure that the hosting process is enabled for the target platform. Probably won't help.
If it repros for new projects then it might be something even more subtle. I would try the following.
Backup HKCU:\Software\Wow6432Node\VisualStudio\9.0 (maybe just rename it)
Delete the same key
Try the repro again
None of the above solutions worked for me(running on a 64x machine).
Finally I clicked on 'advanced compiler settings' and UNCHECKED 'enable optimizations' and I can now step through code and edit while debugging.
For me, for a reason that I don't understand, the setting "Generate debug info" in the "Advanced Compiler Settings" was set to "pdb-only" instead of "Full".
By default, this parameter is always set to "Full" but a mysterious poltergeist has changed this parameter on last night. :)
P.S. I'm in Visual Basic .Net with Visual Studio 2010
If your concern is with an ASP.NET app, ensure you have edit and continue enabled on the web tab (vs2010). There was also a separate setting for ASP.NET debugging in earlier versions.
Regards,
Adam.
I found that even though under project properties build & debug tab are set to Debug and all the other setting are correct I still get the message, however after digging some more
under the Build menu select Configurations Manager... and make sure Debug is selected in two places there as well. go figure...how many different places do they need to set debug?????? even though you set Project - Configuration to Debug then under Build - Manager it is not changed so you have change the same setting there as well Project Configuration - seems like a microsoft issue again.......
This problem is due to Intellitrace setting
If Intellitrace is enabled make sure Intellitrace event only is checked
Otherwise this will not allow edit and continue..
If you will click on Intellitrace options you will see the warnings.
Following shooting helped me using VS2010:
go to Tools, Options, Debugging, General and make sure "Require source files to exactly match the original version" is unchecked.
That happens when the debugger hasn't hit a breakpoint or you haven't hit Break All (pause). It couldn't be that simple could it?
The error says a possible cause is: "the code being debugged was optimized at build or run time". Go to Project Properties->Debug and uncheck the Optimize Code box for Debug mode.
I had this problem in Microsoft Visual Studio 2008 and the solution is easy. when you run your project please set in "Debug" mode not "Release". The another people solution can be useful.
If I create a new project, edits while debugging do not work. If I create a new website, edits while debugging work as expected.
I ran into this today - turns out that having Debug Info set to pdb-only (or none, I'd imagine) will prevent Edit and Continue from working.
Make sure your Debug Info is set to "full" first!
Project Properties > Build > Advanced > Output > Debug Info
In my case just reseting to default debugger settings and setting IntelliTrace-> only intellytrace events helps
Some things that seemed to help using VS2010:
go to Tools, Options, Debugging, General and make sure "Require source files to exactly match the original version" is unchecked.
multiple .vshost.exe instances can be left over from e.g. detaching the VS debugger from a stopped process. This will interfere with breakpoints and compiles as well. Use Task Manager, Processes tab to kill all instances of .vshost.exe by right-clicking each instance and selecting End Process Tree. VS will create a new instance.
I removed a dataset from my project because I didn't use it. After that I could modify the program when debugging.
I did all the changes mentioned in every other answer and none worked. What did I learn? Enable and Continue exists in both the Tools > Options > Debugging menu and also in the Project settings. After I checked both, Enable and Continue worked for me.
Seems illogic, but only way was disabling edit and continue from VS 2017 options... Then AspNet edit and continue began to work...
what worked for me was unchecking "Use Managed Compatibility Mode" under
Tools -> Options -> Debugging
TBN: checking or unchecking "Require source file to exactly match the original version" seems not influences the E&C
Hope this can help.
Enable edit and Continue only work run IIS Express.
Don't work in Local ISS or External Host.
I'm adding my answer because the thing that solved it for me isn't clearly mentioned yet. Actually what helped me was this article:
http://www.rubencanton.com/blog/2012/02/how-to-fix-error-changes-are-not-allowed-while-code-is-running-in-net.html
and here is a short description of the solution:
Stop running your app.
Go to Tools > Options > Debugging > Edit and Continue
Disable “Enable Edit and Continue”
Note how counter-intuitive this is: I had to disable (uncheck) "Enable Edit and Continue".
This will then allow you to change code in your editor without getting that message "Changes are not allowed while code is running".
Note however that the code changes you make will NOT be reflected in your running program - for that you need to stop and restart your program (off the top of my head I think that template/ASPX changes do get reflected, but not VB/C# changes, i.e. "code behind" code).
I install the stackify, when i enable this on icon tray, it stop my debugging with edit, so i found
Close the visual studio , in my case its vs2017
Go to icon tray and right click on stackify icon and disable .NET Profiler
Open Visual studio run application again in debug mode with debugger and it allow me edit while debugging
I had this annoying issue since I upgraded my VS 2019 to 16.4.3 and caused me a lot of headache.
Finally I solved the problem this way:
1. Stop Debugging
2. Select the solution from "Solution Explorer"
3. In the Properties window change the "Active config" Property From "Release|Any CPU" To "Debug|Any CPU"
4. In Debug > Options > General Check the Edit and Continue checkbox
That worked for me, and hope it works for you too.
embed interop types visual studio should be set to false
I had this happen in a linked class file. The rest of the project allowed E&C, but I got the same error editing the linked file. Solution was to break linked file into it's own project and reference the project.
I faced the same problem. My problem was that I could modify a file, but not another (both are in same project). Later I found that the file I couldn't modify was also part of another project. That another project (Unit Test) wasn't loaded, and intelligent VS debugger shows the error that assembly for this given file was not loaded, and changes aren't allowed. How weird!
Hence, I had to unload the unit-test project and continue the EnC debugging.
Sometimes while developing in Visual Studio IDE, when you use "Find in Files" dialog to find something, the search fails and you will see the following message in the "Find Results" window.
No files were found to look in. Find stopped progress
Once this message shows up, all the subsequent searches will result in the same message. Nothing fixes the problem including restarting the computer except pressing Ctrl + ScrLk.
What causes Visual Studio to get into this state and is there a setting to permanently prevent it from happening?
According to this thread:
Posted by Microsoft on 10/13/2009 at
4:33 PM
Hi all,
Thank you for your continued interest
in this bug. We have been able to
reproduce the issue intermittently in
several versions of Visual Studio
running on several versions of Windows
and have identified the root cause as
external to VS. The Windows team
unfortunately did not have time to fix
this for their current release, but we
are working with them to hopefully
have this bug fixed for a future
version of Windows. At present, the
workaround (as many of you noted) is
to press Ctrl+Scroll Lock, Ctrl+Break,
or the Break key alone.
Again, thanks for all of the details
you provided about this bug. If you
have any further questions or
comments, please feel free to post
again here; although this issue was
closed quite a while ago, I'll make
sure it stays on our radar.
Thanks, Brittany Behrens Program
Manager, VS Platform - Editor
This bug has been around since at least 2004 and, as of the above post in 2009, had not been fixed.
Sometimes Ctrl + Break works, sometimes Alt + Break, sometimes Ctrl + Scroll Lock, and other times Alt + Scroll Lock.
Right now, nothing works. This has been a huge problem for me. Shame on Microsoft for not fixing this bug in the last nine years.
Apparently, for those for who the key combinations don't work (like me at the moment), deleting the following registry key brings salvation:
MyComputer\HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\[VS VERSION NUMBER]\Find
Of course, [VS VERSION NUMBER] should be internal version number of the IDE. Don't forget to restart your computer.
Mind you, deleting stuff in the registry is dangerous. Like anyone on SO cares but anyway...
I don't think there is anything you can do to prevent it.
It seems to occur after I have stopped a build with CTRL+Break...Maybe I am pressing CTRL+Scroll Lock during that time???
I have only had it happen to me 2-3 times, and that was several months apart.
What he is saying is that occasionally when performing a search within Visual Studio you get the mentioned error message. Even though you know there is stuff to find. It is some weird state that Visual Studio gets into. If you press the (CTRL+Scroll Lock) it will 'fix' the issue.
There are currently nine bugs on the Connect site related to this and marked as Not reproducible.
I created another one for Visual Studio 2010 SP1: "Find was stopped in progress" while performing search in Visual Studio
Please vote for it if you are unable to perform search.
PS: Microsoft claims that they fixed it in Visual Studio 2012.
I have had this problem and saw peoples' answers about the multiple Ctrl + Break/Pause Scroll Lock combinations.
I considered this, but I thought it a poor workaround (especially as I use a Mac Keyboard so those keys are not easily available).
So the solution I found was to do this:
Menu: Tools → Options → Environment → Find and Replace
Uncheck the top three check boxes (checked by default in my settings).
Re-check the top three check boxes.
Et voila, everything should work fine.
Well, it did for me anyway, which was a relief as I can't believe Microsoft would allow a weird key combination as a work around for a bug like this.
I submit this hoping it may help!
See if this Stack Overflow question helps:
Search stops working for "Entire Solution"
Short version of the solution:
You should try clicking inside the Find Results window, and once the blinking text cursor is visible, hit Ctrl + Break four or five times. That should do the trick.
My experience with this problem:
Steps to Reproduce
I just experienced this using Windows Server 2008 R2 Standard and Visual Studio 2010 SP1.
I was accessing Visual Studio remotely through Citrix Receiver (from my computer, A, to B) and through Windows Remote Desktop (from B to C). In this set-up (chaining two remote sessions), I sometimes have stuck modifier keys.
In B, I had pressed Windows+Pause to access the System Properties window. (This may or may not be related; I suspect there could have been a stuck key press or something.)
Later on, when I opened Visual Studio on C, I had this problem. Note that I always use Ctrl+Shift+F to access the Find All window.
Solution
I solved it by pressing Ctrl+Scroll Lock as suggested in other answers.
Cause
As for why this happens, I did notice that if I press Ctrl+Break while the text cursor is in the Find Results window but before any results are found then the search stops with the same message. This indicates to me that it's related to a keyboard problem.
As reported by others, apparently it's a Windows bug. Here's a discussion about this.
I encountered a very similar problem. I was searching a folder for all files for a phrase in all .cs files in my solution. Visual Studio kept saying "No files were found to look in". (It did not have the "Find stopped progress" part of the message.)
I searched for the message and found this question. The suggested keyboard commands in other answers did not work.
I like to use the keyboard for navigation. I had accidentally hit Alt+B and Space. Alt+B is the shortcut to jump to the "Include sub-folders" checkbox on the Find and Replace form. The space bar cleared the checkbox, and then Alt+A performed a Find All action. Because it was not searching sub-folders, no files were found. The message was correct.
After checking the "Include sub-folders" box, searches found the matching files in sub-folders. So if you're getting the message "No files were found to look in" without the message "Find stopped progress", ensure the search is looking in sub-folders!
I thought I was seeing this problem, but after two days of searching for a solution I figured out that the "Look at these file types" selector had changed and didn't include the file extension I needed.
I had this in Visual Studio 2015 yesterday.
In Find in Files, in the textfield Look in:, I typed
*.*
instead of Entire Solution, and that also caused No files were found to look in.
This is not a Visual Studio bug or Windows bug. It's a keyboard bug. Please see an answer in duplicate question https://stackoverflow.com/a/28219093/147805.
I can reproduce your issue.
There are some steps as following below you can try:
Check the setting Find and Replace (menu Tools → Environment → Find and Replace).
Open "Developer Command Prompt for VS2013" and paste
“devenv.exe /resetsettings”
Use the Visual Studio Setup Wizard (via Control Panel) to repair Visual Studio. You also can read the reference about Find in Files:
http://msdn.microsoft.com/en-us/library/dechx2tz.aspx
I have found another cause of this: Moving the solution folder to a new location, when CMake is part of the build process.
I was working with the Chromium Embedded Framework and moved the main CEF folder from e:\ to c:\ . This seems to break everything including Find because the CMake build scripts it uses hard-code the disk volume and full path (E:\folder) into the source paths.
To be clear, Press Ctrl + ScrlLck, with the Search Window open. That resolved it for me too.