'Step Into' is suddenly not working in Visual Studio

72,113

Solution 1

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.

Solution 2

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

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

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

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

Share:
72,113
Nick LaMarca
Author by

Nick LaMarca

Updated on February 09, 2022

Comments

  • Nick LaMarca
    Nick LaMarca over 2 years

    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.
    
  • Admin
    Admin almost 12 years
    Ok it might be that your debugger is not loading the PDB file related to your module's dll. Here is a good post If you are still facing the problem, please check it. Good Luck.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    It says: WebDev.WebHost40.dll C:\windows\Microsoft.Net\assembly‌​\GAC_32\WebDev.WebHo‌​st40\v4.0_10.0.0.0__‌​b03f5f7f11d50a3a\Web‌​Dev.WebHost40.dll No‌​ No Cannot find or open the PDB file. 3 10.0.40219.1 2/18/2011 10:09 PM 03100000-03112000 [3204] WebDev.WebServer40.EXE: Managed (v4.0.30319) Cannot load symbols, but where are the symbols located?
  • Admin
    Admin almost 12 years
    Have you read the post I mentioned above? While debugging in Visual Studio, click on Debug > Windows > Modules. The IDE will dock a Modules window, showing all the modules that have been loaded for your project. Look for your project's DLL, and check the Symbol Status for it. If it says Symbols Loaded, then you're golden. If it says something like Cannot find or open the PDB file, right-click on your module, select Load Symbols, and browse to the path of your PDB.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    It has symbols loaded on the asp app consuming a wcf service. The only thing that doesnt have symbols loaded is this webDev.WebHost40 this all worked in the past and now doesnt. The degugger hits breakpoints in asp app but wont step into the service code
  • Nick LaMarca
    Nick LaMarca almost 12 years
    What am I to do in Properties/Web tab of the WCF project?
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I deleted all the bin folders for all the projects and re-built them 1 by 1 they all succeeded but still getting the symbols wont load on any breakpoint I put into any project in the solution other than the asp.net project were the breakpoint works. I was able to debug step into all the project before, this is an all of a sudden thing.
  • JMarsch
    JMarsch almost 12 years
    Near the bottom, there is a set of checkboxes -- make sure that the box to enable asp.net debugging is checked.
  • JMarsch
    JMarsch almost 12 years
    Based on your last comment, definitely check on that debuggging settng that we have written about. I have once or twice had that box come mysteriously unchecked (maybe another dev checked it in that way, and didn't take credit, maybe there is some bug lurking in VS that causes it).
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Yes it was checked in the wcf services project
  • JMarsch
    JMarsch almost 12 years
    I'm afraid that the best I've got then are the other 3 steps -- make sure that it is loading the assemblies that you think it is (2), check the config (3), and that suo file -- when it gets corrupted, VS does all sorts of unfortunate things.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I have even took the time to create a blank solution add new projects into it one at a time and then add the existing files and references to the projects. Still the same result
  • Nick LaMarca
    Nick LaMarca almost 12 years
    The confgiuration manager has all the projects checkboxes checked under the Build field
  • JMarsch
    JMarsch almost 12 years
    Is debugging for the web service enabled in the web.config (this separate from the checkbox that we talked about previously): msdn.microsoft.com/en-us/library/e8z01xdh(v=vs.100).aspx
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Yes <compilation debug="true" targetFramework="4.0"/> is in the web.config of the service project
  • JMarsch
    JMarsch almost 12 years
    Could be some environment setting, I suppose. Try this: In VS, go to Tools | Import and export settings | and choose reset settings (there is an option in the wizard to back up your settings -- do that so that you can restore by using the Import settings option if this doesn't fix it)
  • JMarsch
    JMarsch almost 12 years
    One other thing -- Open the .csproj file on your client program. Check the physical path to your web service project and make sure it's correct. Also, check the URL that you are using in your web reference and make sure that it is pointing to the same project -- the 2 most common cases I have seen where you get the "breakpoint will not be hit" message are where the target project is not building, or the path to the target project is different from the path in the solution.
  • JMarsch
    JMarsch almost 12 years
    And yet one more thing to check: are there PDB files for your web services project?
  • JMarsch
    JMarsch almost 12 years
    And one more: I'be been assuming that your web service project is a Web Application. Is it a Web Application or a Web Site? (I don't have much experience troubleshooting Web Sites, because they have always been so problematic, that I always start with a Web Application.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Reset Settings didnt work and I do see a pdb for the service project in the that projects bin folder..
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Here is what the csproj file looks like ( I added it to main question body), I do not see any information about the service in it..
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Both the service project and the website are web application projects to start
  • JMarsch
    JMarsch almost 12 years
    What web server are you using for debugging? IIS Express? Cassini? "Real" IIS?
  • Nick LaMarca
    Nick LaMarca almost 12 years
    whatever comes out of the box with visual studio..localhost
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I used to be able to debug..this is a new revelation out of no where and I cannot seem to know what I coulda done to make this not work. I can debug the top level but it wont step into the projects anymore
  • JMarsch
    JMarsch almost 12 years
    For both the web service and the web app projects, right-click on properties and go to the Web tab. Check which option you are using for the web server (Options will be VS development server, IIS, and, if you are running 2010 with SP1, IIS Express). If you are not using one of the development servers, try switching to one of them. If that fixes it, then the problem is probably in config options for the full IIS. If not, then I'm still not sure what's going on.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Its using VS development server
  • JMarsch
    JMarsch almost 12 years
    THe only thing left that I can think of is to check the URL for the service. Check both the service reference on the client, and the URL as it appears in the service application's config, and make sure that they match. Here's my guess: Your service-side breakpoint is displaying as "will not be hit" because casini has not loaded it (it has no reason until you hit it, and I can repro that behavior), but then, your client-side web app is hitting the wrong URL, so casini is never loading the service.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    My service project has a web.config but I do not see where the service url is?
  • Nick LaMarca
    Nick LaMarca almost 12 years
    <endpoint address="localhost:1374/OrderService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_iWebServices" contract="ServiceReference1.iWebServices" name="BasicHttpBinding_iWebServices" />
  • JMarsch
    JMarsch almost 12 years
    If there is nothing in web.config in the service (and if you are targetting .net 4.0 -- NOT 3.5), then open the properties for the web service project. Go to the Web Tab, and look at the port number and virtual path assigned to the web app (virtual path is probably just "/"). Your service url will be localhost:(the port number)/(the virtual path, if there is one)/YourService.svc
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I changed it from the "/" now I keep getting this error and I cant get rid of it even if I put the "/" back in .. Server Error in '/localhost:1374/OrderService.svc' Application.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    Server Error in /http: //localhost:1374/OrderService.svc Application. Is the error
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I think the virtual path is all messed up now. How do I reset it?
  • JMarsch
    JMarsch almost 12 years
    That should be all it takes to reset -- I verified on a project here. Make sure that you are changing the right project. Try stopping the development web server (in your task tray). If all else fails, you could edit your csproj file, and look for the <DevelopmentServerVPath>/</DevelopmentServerVPath> tag --it should just contain the forward slash.
  • John
    John almost 12 years
    @NickLaMarca: As you might know, the dll you're referencing is the Cassini web host. I don't believe there's a need to have symbols loaded for this. If it's not a web application code file, the code file/project you're setting your breakpoint should be the module you're looking for in the modules window. If you find that, you can start working on getting the correct symbols file loaded.
  • John
    John almost 12 years
    @NickLaMarca: Also, you're not trying to step into a property are you? There's a setting for this operation as well in the debugging options.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I am stepping into methods not properties. All this worked before then all of a sudden stopped stepping in, I cannot figure out why this could be? Breakpoints used to now say "Symbols not loaded" in the service project but now they do
  • John
    John almost 12 years
    You've probably not changed this, but have you checked under the project properties for the service, advanced build settings, under output? Is debug info set to full?
  • John
    John almost 12 years
    Might as well go ahead and check Options/Debugging/Symbols and make sure that looks okay as well (All modules, unless excluded, etc.).
  • Nick LaMarca
    Nick LaMarca almost 12 years
    we are talking about the project with the service in it correct?
  • Nick LaMarca
    Nick LaMarca almost 12 years
    where is the Detailed log file I look at this stuff located at?
  • John
    John almost 12 years
    The output window's detail is what I was referring to. Set the output as I mentioned and this is the log information I'm referring to. If your service project is what you're not able to debug, then that's the one I'm talking about rebuilding with verbose/detail logging to output window (among the other suggestions as well to this project, e.g. debug configurations mentioned). Then, this service application (that you can't step into), look for that service's assembly name (AssemblyName.exe) and look for the pdb, e.g. AssemblyName.pdb and the actions I mentioned, in that verbose output.
  • John
    John almost 12 years
    The output you posted is not what I was wanting you to look for, rather something like: Task "Copy" Copying file from "obj\Development\YourAssembly.pdb" to "bin\Development\YourAssembly.pdb". This line would indicate that it did build the symbol file and shows where it should be.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I am not sure where to find that information. The information posted is what was in my output window
  • John
    John almost 12 years
    See above: "Set the project's build output to detailed or verbose (Tools/Options/Projects & Solutions/Build & Run/MSBuild project build output verbosity)." This information will be displayed in the output window after you rebuild the project.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    All those items checked out to be fine
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I am not sure how to use this code. Do I just create a console app with your ClearVS2010 routine and run it? What does ClearFolder look like?
  • AMissico
    AMissico almost 12 years
    It is part of a script, use it as a reference only. From the Run dialog, just type the environment variable and press Enter. That will open Window Explorer. Navigate to the folders then delete the files.
  • Nick LaMarca
    Nick LaMarca almost 12 years
    I tried to just click the step into button in vs but still same result
  • Axxelsian
    Axxelsian almost 12 years
    Are you able to use the step-into function in other projects or is it just within this project that step-into does not work? It might just be a VS core problem.
  • Matt
    Matt over 10 years
    I've edited this answer. Read the update to see how to use it. In a real world scenario, you might want to replace the popup by a delete statement to remove the files, not just display the paths.
  • Matt
    Matt over 10 years
    If you want to add delete code, you can find an example here.
  • Ajay Sharma
    Ajay Sharma almost 9 years
    Thanks, Only Delete SUO file and temp folder is enough to make debugger runnable.
  • AMissico
    AMissico over 8 years
    >>Delete SUO file and temp folder is enough<< Not always.
  • Mike Burger
    Mike Burger over 6 years
    My case was similar, but it was just that I was never using the results of the IEnumerable, so even though it ran, it never got to the break. Once I added an additional line that used the results of the IEnumerable, all of the breakpoints were hit.
  • Martin Braun
    Martin Braun over 2 years
    You can find the window at Debug > Windows > Modules while debugging.