'Step Into' is suddenly not working in Visual Studio

.NetVisual Studio-2010DebuggingVisual Studio-Debugging

.Net Problem Overview


All of a sudden, I have run into an issue where I cannot step into any code through debugging in Visual Studio. The step over works fine, but it refuses to step into (F11) any of my code. This was working before, now all of a sudden it does not.

I've tried some things below, but I still had no success:

  • Delete all bin files in every project in my solution, clean solution, re-build solution.

  • Build projects in solution indivdualy

  • Restart machine

It an ASP.NET C# application consuming a WCF sevice locally. It is in debug mode. I have a breakpoint set on the page consuming the service. The breakpoint hits, but it will not step into the service code.

The ASP.NET site and the service code is all in the same solution. This all of a sudden does not work, it did work before.

How can I fix this problem?

Adding a breakpoint to the service project I get a warning:

> Breakpoint will not currently be hit. No symbols have been loaded for this document.

I deleted all the bin folders for all the projects and re-built them one by one. They all succeeded, but still I am getting the symbols won't load on any breakpoint I put into any project in the solution other than the ASP.NET project where the breakpoint works. I was able to debug step into all the projects before, this is an all of a sudden thing.

Information from the output window..

'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf3856ad364e35\System.Runtime.DurableInstancing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml.Hosting\v4.0_4.0.0.0__31bf3856ad364e35\System.Xaml.Hosting.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2d49cf50\14eee2cf\App_Web_jmow15fw.dll', Symbols loaded.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Discovery\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Discovery.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Routing\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Routing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Channels\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Channels.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

.Net Solutions


Solution 1 - .Net

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 <https://stackoverflow.com/questions/7021116/c-sharp-vs2010-entering-break-mode-failed/7021171#7021171>;.

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.

Solution 2 - .Net

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.

Solution 3 - .Net

enter image description here
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:

  1. With the project open but not running make sure the Standard tool bar is displayed (it probably is because it's the default)
  2. 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

Solution 4 - .Net

Visual Studio does not step into the code when it cannot load the symbols (.PDB file) of the DLL.

Below, there is a link to an article and some screenshots that explains how to discover where visual studio is trying to load the PDB files. Once you find out which directory you have, just copy the .pdb files there and Visual Studio will step into.

https://devblogs.microsoft.com/devops/understanding-symbol-files-and-visual-studios-symbol-settings/

Modules Window --> Debug > Windows > Modules

Modules Window --> Debug > Windows > Modules

Symbol Load Information....

Symbol Load Information Window

Solution 5 - .Net

Try this:

  1. Remove temporary ASP.NET files from the %temp% location.
  2. Clean and build projects in your solution one by one and then build your host and try debugging.

It worked for me.

Solution 6 - .Net

Your F11 key may be rebound to something else. It may work if you click the step-into button in Visual Studio.

Solution 7 - .Net

  1. Is the WCF project a web application as well? Is ASP.NET debugging enabled for it? (right-click on the WCF project, go to Properties | Web)

  2. I've also had this happen to projects when the references are messed up -- make sure that the reference from the web application is to the same copy of the project as the one in the solution.

  3. Check the configuration manager (in Solution Explorer, right-click on solution | Configuration Manager), and make sure that both projects are building.

  4. Sometimes the .suo file gets corrupted, and you can get all sorts of weird behavior. You can try deleting it (make a backup copy if you are paranoid, see The evil suo file - fighting and winning with Visual Studio).

Solution 8 - .Net

I had the same issue.

I wanted to step into a method that returns an IEnumerator and I was calling it just by simple call (just the name of the method).

private void Start()
{
    GetTagsFromCloud();
}

But since it runs in the background, it is better to call it with the following way.

private void Start()
{
    StartCoroutine(GetTagsFromCloud());
}

Solution 9 - .Net

If you can still step into using the toolbar but F11 is dead, perhaps there is nothing wrong with Visual Studio but there is a higher priority consumer for the keystroke and never reaches Visual Studio.

You can verify that by using the key with another program, like another application or a game. If it does not work there either, then that is the case.

It is good to give a try before messing with VS because it is faster and safer. You may end up reinstall the entire studio only to realize the issue is still there.

I had the same problem and in my case the higher priority consumer was Nvidia geforce experience where i had set F11 as FPS indicator toggle. When i turn off the in-game overlay of this program(that is always active and ready for keystrokes to show fps, record, take snapshot, broadcast etc) F11 worked like a charm after a PC restart.

I assume that there are other always-on applications of same or similar role that may consume the keystroke.

Solution 10 - .Net

Had this issue in VS2022 preview and deleting the .suo file fixed it.

Had to search for the file using file explorer. Also the file is contained within a hidden .vs folder.

Solution 11 - .Net

Based on what I've read and understood, you should look for the following file:

Project's Assembly Name.pdb in the bin directory. If you don't see it, it's not getting built. See my comments on setting debug info to full, and Options/Debugging/Symbols.

Set the project's build output to detailed or verbose (Tools/Options/Projects & Solutions/Build & Run/MSBuild project build output verbosity).

Look for certain tasks with this file (i.e. AssemblyName.pdb), delete, copy, etc., and see if you can find out if it's (attempting) to delete the pdb file, where it's referencing from (dll/exe) where it's putting it, copying it, etc.

If it's not being built, you'll only see delete tasks. If it is, you'll see copy and reference tasks. These copy and reference paths will tell you where you need to point the modules console of that assembly (AssemblyName.exe) to get it's symbol file (i.e. where that pdb file was copied).

Solution 12 - .Net

In my case I was running a web app out of Visual Studio. The assembly I was trying to was referenced from a location in my regular file system, but at runtime it was being loaded from the GAC. I always thought .NET tried to load from the local bin first then GAC, but I guess not. Anyway, it wasn't able to find the .pdb debugging symbols for the version in the GAC and that's why I wasn't able to step in. Once I updated the assembly in the GAC and provided the .pdb file, it worked.

Solution 13 - .Net

If you customized output path, Make sure all your output paths are pointed to the same output directory

Solution 14 - .Net

In my case I was trying to step into a web service method and it wasn't working. Started working after I've resolved an instance of the service using Unity.

More info here: Resolving Instances of Types Using Unity

Solution 15 - .Net

In my case in VS2008 checking the option "Enable unmanaged code debugging" under Project Properties|Debug did the trick. I don't know why this worked since all the code in the project is in vb.net.

In later versions this option has been renamed to "Enable Native code debugging".

Solution 16 - .Net

I was having this problem too, turns out the method I was expecting to step into was being Moq'd (I was debugging a test). This Moq just returned.

Solution 17 - .Net

On VS 2005, check if Optimization under c/c++ (project property) is set to Maximize Speed(/02). Change the settings to Disabled(/Od).

Solution 18 - .Net

Some solution, which can be not so obvious. Check your language setting and change it to English. I know it sounds stupid, but I solved it after 2 hours. I didn't even realize that I had it set to my secong language

Solution 19 - .Net

Shutdown Visual Studio then restart worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNick LaMarcaView Question on Stackoverflow
Solution 1 - .NetAMissicoView Answer on Stackoverflow
Solution 2 - .NetJosh NoeView Answer on Stackoverflow
Solution 3 - .Netuser2721607View Answer on Stackoverflow
Solution 4 - .NetDaniel ReisView Answer on Stackoverflow
Solution 5 - .NetAbhishek TyagiView Answer on Stackoverflow
Solution 6 - .NetAxxelsianView Answer on Stackoverflow
Solution 7 - .NetJMarschView Answer on Stackoverflow
Solution 8 - .NethuynhfView Answer on Stackoverflow
Solution 9 - .NetStefanos ZilellisView Answer on Stackoverflow
Solution 10 - .NetAlex DView Answer on Stackoverflow
Solution 11 - .NetJohnView Answer on Stackoverflow
Solution 12 - .Netxr280xrView Answer on Stackoverflow
Solution 13 - .NetPrasanth V JView Answer on Stackoverflow
Solution 14 - .NetIvan SantiagoView Answer on Stackoverflow
Solution 15 - .NetWill PepponiView Answer on Stackoverflow
Solution 16 - .NetWjdavis5View Answer on Stackoverflow
Solution 17 - .Netdpen82View Answer on Stackoverflow
Solution 18 - .NetborekView Answer on Stackoverflow
Solution 19 - .NetTienView Answer on Stackoverflow