'Step Into' is suddenly not working in Visual Studio
With Visual Studio closed:
- Delete the solution's suo file (contains debug information, user settings such as break points, bookmarks, and other user settings.)
- Delete the Visual Studio cache files (see below)
- Delete all temporary files (a shift from VS9 to VS10 is that VS10 uses the temp folder)
- Manually delete all obj and bin folders using Windows Explorer.
Open Visual Studio and rebuild all. This always works. See C# VS2010 Entering break mode failed.
For reference:
Private Sub ClearVS9
ClearFolder(oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Microsoft\VisualStudio\9.0\ProjectAssemblies")
ClearFolder(oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Microsoft\VisualStudio\9.0\Recent")
ClearFolder(oShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Local Settings\Application Data\ApplicationHistory")
ClearFolder(oShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies")
ClearFolder(oShell.ExpandEnvironmentStrings("%WINDIR%") & "\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files")
End Sub
Private Sub ClearVS10
ClearFolder(oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Local\Microsoft\WebsiteCache")
ClearFolder(oShell.ExpandEnvironmentStrings("%APPDATA%") & "\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies")
End Sub
See the link The evil suo file - fighting and winning with Visual Studio mentioned by JMarsch.
In my case, I was stepping into a method which yielded return of an IEnumerable
. In this situation, F11 may skip over the method until the IEnumerable
is iterated, since its execution is deferred until then.
My issue was that when I set a breakpoint the code would properly stop at that point but when I pressed F10 or F11 the code would simply finish running instead of going to the next line. I also noticed that while the code was stopped at the breakpoint I could not use my cursor to hover over my variables to see their values. Here is how I corrected the problem:
- With the project open but not running make sure the Standard tool bar is displayed (it probably is because it's the default)
- Look at the drop down list in the toolbar that has the options Debug, Release, Configuration Manager. Select Debug from this list. Mine was set to Release