user146584
user146584

Reputation: 701

Strange! VS 2005 -Break Point is not being hit

I am using Visual Studio 2005.I am running my code in Debug mode only.But my break point is not being hit.

I followed :


  1. Cleared my solution and created the one again
  2. Closed the VS and Opened it again
  3. Restarted my PC and tested the break point

But i am unable to figure out the problem.

My Question is:


  1. Is it due to any virus ?
  2. Add-on feature in my IE 8.0 prevents this
  3. My VS is Corrupted ?
  4. I am having botn VS 2008 and VS 2005 installed in my machine so any version conflicts?

Suggestion is needed.

Upvotes: 1

Views: 6366

Answers (3)

Scott Dorman
Scott Dorman

Reputation: 42516

It sounds like the problem you are having may be due to the source code and the .pdb files being out of sync with each other.

Try these steps:

  1. Perform a "Clean" build in Visual Studio.
  2. Shut down Visual Studio.
  3. Delete any "bin" and "obj" folders in all of your project folders.
  4. Delete the solution .suo file

Sometimes the solution .suo file can become corrupt (doesn't cause Visual Studio to indicate any errors, but usually leads to strange behavior). Nine out of ten times, deleting the .suo file clears any strange behavior in Visual Studio.

The trick about deleting the "obj" folders forces Visual Studio to truely do a clean build the next time it compiles. Doing a "clean" build in Visual Studio only deletes the compiled binary results, it doesn't remove any intermediate object files that may have been created that Visual Studio might be linking against. By manually deleting the "obj" folders, you delete those cached object files and force a true rebuild.

Upvotes: 7

Nader Shirazie
Nader Shirazie

Reputation: 10776

What kind of project is it (website, console app, ...) Are you running the project directly from visual studio, or attaching to it afterwards?

Usually when this happens to me, its because the assemblies that are being used to run the process I want to debug do not match the currently built assemblies from visual studio.

You mention IE8, so if this is a website, you should try to attach visual studio to the w3wp.exe process. Otherwise the breakpoint won't have any effect. Alternatively, run the website using visual studio.

Upvotes: 1

Andy
Andy

Reputation: 30418

If you hover over the breakpoint in Visual Studio, does it indicate an error? Common problems are that the code hasn't been built, or the DLL that contains the code isn't loaded into the debugged process.

Upvotes: 0

Related Questions