Open Closed

Debugging in VS consistently runs older version (since 9.x upgrade?) #9457


User avatar
0
brauerj@gc.adventist.org created

I am increasingly having the issue where when I make changes to my ABP Blazor Server project (recently upgraded to 9.x) and press "Start Debug" in Visual Studio it almost always runs an old version of the code and does not catch break points. This is now happening on both of my ABP projects (now that they've been upgraded?). Only after debugging sometimes several times does it catch the new code.

Anyone else having this issue? It's VERY annoying.

I'm not sure how to make a "demonstration" of the issue without a large complex project.

Thanks,

Jonathan


6 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This issue is often related to Visual Studio's build and debugging behavior, especially after major upgrades or project migrations. Here are steps to help resolve the problem:
    1. Clean and Rebuild Solution

      • In Visual Studio, select Build > Clean Solution, then Build > Rebuild Solution. This ensures all old binaries are removed and rebuilt.
    2. Delete bin and obj Folders

      • Manually delete the bin and obj folders in all your project directories. Sometimes, stale files can cause old code to run.
    3. Check for Multiple Startup Projects

      • If you have multiple startup projects, ensure you are debugging the correct one. Misconfiguration can cause breakpoints to be missed.
    4. Disable "Just My Code" and Enable Source Link

      • Go to Tools > Options > Debugging > General:
        • Uncheck "Enable Just My Code".
        • Check "Enable Source Link support".
      • This helps Visual Studio step into the correct code and improves debugging reliability.
    5. Clear Visual Studio Component Cache

      • Close Visual Studio.
      • Delete the .vs folder in your solution directory.
    6. Restart Visual Studio and Your Machine

      • Sometimes, lingering processes or locked files can cause issues. A full restart can help.
    7. Check for Hot Reload Issues

      • If you are using Hot Reload, try disabling it to see if the problem persists. Hot Reload can sometimes cause the debugger to attach to outdated code.
    8. Update Visual Studio

      • Ensure you are using the latest version of Visual Studio, as recent updates include important fixes for debugging .NET and Blazor projects.
    9. Compare with a New Template Project

      • As recommended in the ABP migration guide, create a new ABP Blazor project with the same version and compare project files and settings. This can help identify configuration issues introduced during the upgrade.

    If the problem continues after these steps, consider creating a minimal reproduction by starting from a new template and gradually adding your code until the issue appears.

    Sources:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    brauerj@gc.adventist.org created

    I did the following steps:

    • Unchecked "Enable Just My Code"
    • ran abp clean (to delete all bin and obj) folders
    • deleted .vs folder
    • rebooted
    • and rebuilt the code base in VS

    and the problem STILL persists! I made a small change and ran it and no break points were reachable. Had to run debugger twice to get break points (and probably most recent code).

    After trying again it ran the correct code but now won't hot reload a simple change.

  • User Avatar
    0
    brauerj@gc.adventist.org created

    Happened again on the other large project although it almost seemed that it just ignored all of the changes that were successfully made and shown via “hot reload” in the last debug session. Debugging again showed none of those changes at all. Stopping and starting resolves the issue (but the project is fairly big so takes awhile to build).

  • User Avatar
    0
    brauerj@gc.adventist.org created

    Happened again. I very clearly changed a .cs file (DBContext definition), hit stop debug and then hit start debug. and it acted like I’d never made the change! Hit stop again and start again, same issue.
    Stop and start again, and finally it used the new dbcontext configuration.

    THREE times before it worked!! :'(

    Why am I seeing this?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can use dotnet run command to run your project. If this command works, that means VS has a problem.

    Thanks.

  • User Avatar
    0
    alper created
    Support Team Director

    or try Rider to see if this is directly related to the ABP source-code

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on July 08, 2025, 08:19