locked
Debugger.Breakpoints FileLine getting changed after closing the file RRS feed

  • Question

  • Hi All,

    Debugger.Breakpoints FileLine getting changed after closing the file, we are using below code for adding the breakpoints 

    EnvDTE.DTE dte = this.ServicProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE; 

    dte.Debugger.Breakpoints.Add(

    null, fileName,lineNumber, 1, string.Empty, EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue,"ABC", string.Empty, 0, string.Empty, 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);  

     Immediately after this if i try to query the BreakPoints i am  able to get the correct line numbers but  if i close my file and open the file again and if try to query the breakpoints the line numbers(FileLine) is getting changed. It is getting changed to (1,2,3,..) 

    Below is the code we are using to query the break points:

    EnvDTE.DTE dte = this.ServicProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;

    int LineNo;

    foreach (EnvDTE.Breakpoint bp in dte.Debugger.Breakpoints)

    {

    LineNo = bp.FileLine;

    }

    Please let me know if anyone else faced the same issue or if someone knows the reason for it.

    Regards,

    J P V 

     

    Thursday, August 26, 2010 9:58 AM

Answers

  • Thanks chen,

     

     

    Thanks for the reply fortunately all of a sudden it started working J … after we did some of the missing Interface implementation. Right now I don’t know which method implementation made it working … I’m in the process of filtering it out… once I have my answer I will post the same here.

     

     

    Thanks & Regards,

    J P V

    • Marked as answer by Victor_Chen Wednesday, September 1, 2010 9:47 AM
    Monday, August 30, 2010 6:46 AM

All replies

  • Hi J P V,

     

    Thanks for your post.

    I'm trying to reproduce this issue.

    From your description, I just suspect that are the file lines you set as parameter able to be set a breakpoint?

    Looking forward to your reply.

     

    Best Regards,

    Ziwei Chen

    Monday, August 30, 2010 3:36 AM
  • Thanks chen,

     

     

    Thanks for the reply fortunately all of a sudden it started working J … after we did some of the missing Interface implementation. Right now I don’t know which method implementation made it working … I’m in the process of filtering it out… once I have my answer I will post the same here.

     

     

    Thanks & Regards,

    J P V

    • Marked as answer by Victor_Chen Wednesday, September 1, 2010 9:47 AM
    Monday, August 30, 2010 6:46 AM