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)
-
0
- 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:
Clean and Rebuild Solution
- In Visual Studio, select
Build > Clean Solution
, thenBuild > Rebuild Solution
. This ensures all old binaries are removed and rebuilt.
- In Visual Studio, select
Delete bin and obj Folders
- Manually delete the
bin
andobj
folders in all your project directories. Sometimes, stale files can cause old code to run.
- Manually delete the
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.
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.
- Go to
Clear Visual Studio Component Cache
- Close Visual Studio.
- Delete the
.vs
folder in your solution directory.
Restart Visual Studio and Your Machine
- Sometimes, lingering processes or locked files can cause issues. A full restart can help.
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.
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.
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:
- ABP Blazor Web App Migration Guide (Troubleshooting)
- Debugging ABP Framework Internals & Visual Studio Debugging Tips
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.
-
0
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.
-
0
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).
-
0
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?
-
0
hi
You can use
dotnet run
command to run your project. If this command works, that means VS has a problem.Thanks.
-
0
or try Rider to see if this is directly related to the ABP source-code