dotnet / dotnet/aspnetcore

Debugger runs old ASP.NET Blazor (server) code first time. Have to debug twice to get code changes.

Open
#63,444 1 comment 0 reactions 1 assignee Claimed by @tmat View on GitHub
area-blazor Author: Migration Bot :robot: feature-hot-reload
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Debugger-runs-old-ASPNET-Blazor-server/10920822)._

---
\[severity:It’s more difficult to complete my work\] \[regression\] \[worked-in:.net 8\]
I am increasingly having the issue where when I make changes to my ASP.NET Blazor based projects (built using ABP 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. I see many other people have submitted similar issues but they all seem to time out. I have this happening on my two major projects. The issue is they are large projects and I’m guessing their increased size could be part of the issue. So I can’t really make a “demo” to demonstrate the issue (that I know of). If there is a way to share projects securely that might be possible but still difficult because of database dependencies etc.

Only after debugging sometimes several times does it catch the new code. As I said this is now happening on both of my new projects (possibly related to my .net 9 upgrade).

Thanks for any help you can provide!

Jonathan

---
### Original Comments

#### Jonathan Brauer on 6/11/2025, 10:57 AM:

I did the following steps:



  • Unchecked “Enable Just My Code”

  • ran abp clean (to delete all bin and obj) folders

  • deleted .vs folder

  • and rebooted


and the problem STILL persists! I made a small change and ran it and no break points were reachable.


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

#### Jonathan Brauer on 6/11/2025, 00:27 PM:

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).

#### Jonathan Brauer on 6/11/2025, 01:59 PM:

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?

#### Feedback Bot on 6/11/2025, 09:26 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.