Breakpoints does not hit

Hello there,

I was trying to execute my program. Well, I set breakpoints but it never hits the function.:(

Any suggestions?

Thanks
developer2012Asked:
Who is Participating?
 
käµfm³d 👽Commented:
I think it is in flow of execution, May be I am missing anything.
For example, if you were writing a Forms application, you may have a button, and that button might have a button handler. You can put all the breakpoints you want inside that handler, but if you never click the button, no breakpoint would be hit.

Now that was just a generalized example. For your scenario, what I am saying is that if you had something like this:

class Program
{
    public static void Main(string[] args)
    {
        MethodA();
    }

    public void MethodA()
    {
        Console.WriteLine("This is method A.");
    }

    public void MethodB()
    {
        Console.WriteLine("This is method B.");
    }
}

Open in new window


Execution begins with Main. The only thing Main is doing here is calling MethodA. If you put a breakpoint on line 14, it would never be hit, because you haven't called MethodB anywhere. This is what I meant by "flow of execution." In this case, you have:

Main->MethodA

There is no logic that will cause MethodB to be invoked.
0
 
käµfm³d 👽Commented:
Are you in DEBUG or RELEASE mode? Also, do you have the .pdb files in the directory of your application when debuggin?
0
 
developer2012Author Commented:
I am in debug mode.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
käµfm³d 👽Commented:
Forms, console, or web application?
0
 
developer2012Author Commented:
Vb.net Forms.. Thnaks
0
 
käµfm³d 👽Commented:
Does your bin\debug folder show any .pdb files? If so, does it show a .pdb file for the assembly which contains the code file in question?
0
 
developer2012Author Commented:
Yes. I have pdb file too...:(
0
 
developer2012Author Commented:
I checked it out. My breakpoints are working very well. But, It is not hitting the function on which I set the breakpoints.
0
 
käµfm³d 👽Commented:
Is that function in the flow of execution?
0
 
developer2012Author Commented:
I am stuck there  I think. I am doing something wrong? Thanks
0
 
developer2012Author Commented:
I think it is in flow of execution, May be I am missing anything.
0
 
CodeCruiserCommented:
It would be really hard for us to guess anything here so show us some code.
0
 
developer2012Author Commented:
Thanks Kaufmed.
I will try that.

@ Code Cruiser.
It is a big programs with thousands of lines of code.

Thanks  
0
 
CodeCruiserCommented:
Do you have call to that function anywhere? Is this call under some conditions (IF Else etc)? Are you those conditions being met? You may want to set the break point in a function higher up in call hierarchy to see if the call to the function is being skipped.
0
 
developer2012Author Commented:
Do you have call to that function. Yes I have

Is this call under some conditions:  Yes

Are condition being met: I believe yes. I followed the same breakpoints which my sr porgrammer did, But, It is not working for me. I am missing something important may be.
0
 
CodeCruiserCommented:
> I am missing something important may be.

I do see dreams occasionally but do not bet on me coming up with that missing thing in my dream :-)
0
 
developer2012Author Commented:
Thanks everyone for bearing me very patiently. :).Finally, I figured it out and I got the results.

Thanks Kaufmed.
0
 
käµfm³d 👽Commented:
Can you share what the issue turned out to be?
0
 
developer2012Author Commented:
Flow of execution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.