Hey everyone,

I have this really weird problem with Visual Studio .Net. If I add some breakpoints here and there on some pages and then run my app., the breakpoints move to some other lines (not always lines with code, and breakpoints dont span the same length as the code). It looks as if code I recently added is not included when I run it.

Has anyone had this problem?

Thanks

Dani AI

Generated

those breakpoints that jump to odd lines almost always mean the source file open in VS does not match the assembly that actually loaded. When you created a new project, VS forced a clean rebuild and picked up fresh DLLs/PDBs, which is why it suddenly worked. In ASP.NET this mismatch often comes from debugging an old assembly in the Temporary ASP.NET Files cache or attaching to the wrong process. See Microsoft’s guidance on diagnosing symbol issues via the Modules window. Troubleshoot breakpoints.

Try this quick checklist:

  • While debugging, open Debug > Windows > Modules, find your web assembly, and confirm Symbols loaded points to your project’s bin\Debug PDB, not a temp path. If it does not, reload symbols or rebuild. Troubleshoot breakpoints.
  • Clear ASP.NET’s compiled cache: stop IIS/dev server, delete only the contents of %SystemRoot%\Microsoft.NET\Framework[64]\<version>\Temporary ASP.NET Files, then rebuild. This removes stale DLLs/PDBs that cause breakpoints to rebind to blank lines. Understanding ASP.NET dynamic compilation, and Microsoft’s IIS team confirms it is safe to clear the cache contents. .
  • Ensure a Debug build with symbols. In Web.config, set debug="true" while you are troubleshooting (switch back to false for production). Debug mode in ASP.NET.
<system.web>
  <compilation debug="true" />
</system.web>

Also verify you are attached to the correct worker process. For classic ASP.NET on IIS, attach to aspnet_wp.exe (IIS 5.x) or w3wp.exe (IIS 6.0+); wrong process = wrong modules/symbols. ASP.NET debugging overview.

is right that services can get in the way, but aligning the loaded module with the matching PDB and purging stale caches is the reliable fix. Troubleshoot breakpoints.

Recommended Answers

All 5 Replies

I created a new project, added all the exact same file to it and now I don't have the problem anymore. I don't really understand why because I had tryed this a couple of tiomes before and it didn't work. The problem is solved but I would still like to have some explanation on the subject if somebody can provide one.

Thanks

Thats because VS.NET is BAD. Dont play with it. LOL Jus kidding

I think there should be some problem with your Machine Debug Manager. Visual Studio.NET uses a service called Machine Debug Manager (MDM.EXE) to do debugging. Its an external and Privilege service.
It screws up sometimes and most of the problem created by this service will be solved if you recreate the application or sometimes restart the whole application (Worse case).

Like I previously said, I don't have the problem anymore. I wouldn't restart the app from scratch... it has been in development for over a year. ;)

Thanks anyway

I got a link that answers my questions:
http://www.controlav.com/bphelper/bpbound.asp?product=7.1&code=m

:D Well you mistook recreate the application keyword. It basically means what you just did. Create a new project and add these files to it. Or what I usually do is delete the Solution file and rebuild the project. It works fine.

Redo the whole project from scratch, Boy I not a mad man. :mrgreen: :mrgreen:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.