views:

199

answers:

6

Hi,

My debugger is not working,
I'm putting a breakpoint, but in run, time visual studio doesn't stop on the breakPoint.
How to fix it?
There is nothing special in my application, it is a simple web application. I am using visual studio 2005.

I've created a new web application project, and on the default.aspx page there is a obout grid control, on the default.cs i am filling a datatable and putting it as datatasource for the grid.
I was able to debug it, suddenly the debugger is never hit.
note that the debugger is on the load event.

+3  A: 

There are a couple of things that could be wrong:

  • Your source code and assembly could be out of sync - rebuild the application and try again.
  • You could be attached to the wrong process - check to see what process you are attached to.
  • There could be a logical error in your code that is causing your breakpoint to not be hit (i.e. the method you are in is not actually called, logical branching is routing control around the breakpoint, etc.)
Andrew Hare
+1: Logic Errors are the most common reason for "debugger is not working"
S.Lott
I've rebuilt my project, and i am not attaching the debugger to any process.It is a project with only one page and i have a code on load event, and there is no references or other projects added!!!
Gaby
Can you edit your question to provide a step-by-step breakdown of exactly what you are doing? There are several potential points of failure and if you give us a complete breakdown we will be able to better help. :)
Andrew Hare
Put a breakpoint on the first line of your page_load event and see if it gets hit.
Oded
it never get hit
Gaby
A: 

Do a Clean Project, and make sure you click Debug, not Run

Pentium10
+1  A: 

The symbols probably aren't loaded, that's why the breakpoint won't be hit. Did you set the website as the startup project?

When debugging, what process it attached? It should be w3wp.exe if you want to debug asp.net code.

Gerrie Schenck
It might not be w3wp.exe if they are testing with Cassini.
Andrew Hare
+2  A: 

You might need to set your application in web config so that it can be debugged..

<system.web>
    <!-- 
        Set compilation debug="true" to insert debugging 
        symbols into the compiled page. Because this 
        affects performance, set this value to true only 
        during development.
    -->
    <compilation debug="true">
        <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        </assemblies>
    </compilation>
Aim Kai
+1  A: 

You need to be running in Debug mode, and not Release mode.

Here's a detailed article about How to: Enable Debugging for ASP.NET Applications Basically, you can either set debug mode in project properties or in web.config.

DOK
+1  A: 

Find below the steps that solved my problem:

  1. Delete ASP.NET temporary files from C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
  2. Change build configuration to debug from project properties.
  3. Delete bin folder from your project.
  4. Check if compilation debug is set to true in the web.config
  5. iisreset
  6. Rebuild the project.
Gaby