7 Replies - 1814 Views - Last Post: 16 January 2013 - 03:19 PM Rate Topic: -----

#1 Simen236  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 07-April 10

Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 04:04 AM

Not so long ago I installed VS 2012 and I quickly noticed something very irritating when debugging in C#. When debugging Windows Forms Applications, I want it to go straight to the code I've written, but it always goes through the InitializeComponent() method. Is there any way I can make the IDE skip this?
Is This A Good Question/Topic? 0
  • +

Replies To: Skip code when debugging (VS 2012)?

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1002
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 04:09 AM

What do you mean it "always goes through InitializeComponent()"?

That's a valid step in your application's setup, leading you to your designer code. You can simply Step Over (F1) this if you don't want to go into the method when it breaks.

This post has been edited by RudiVisser: 16 January 2013 - 04:10 AM

Was This Post Helpful? 1
  • +
  • -

#3 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3243
  • View blog
  • Posts: 10,882
  • Joined: 12-December 12

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 04:16 AM

Create a Breakpoint by right-clicking the line you want to stop at, or by clicking to the far left of the line, then pressing Start will run to the line. Then you can Step Into F11 or Step Over F10 (if you don't want to jump to called procedures/methods).

You can also right-click the line and choose Run to Cursor.
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3479
  • View blog
  • Posts: 10,724
  • Joined: 05-May 12

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 05:46 AM

Also check you key mappings. You may have installed or inherited one set of key mappings on your old IDE, and you may have installed the default key mappings when you installed VS2012 instead of porting over your old key mappings from your older IDE.
Was This Post Helpful? 1
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5437
  • View blog
  • Posts: 11,667
  • Joined: 02-June 10

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 07:28 AM

SOunds like you could use a few pointer to debugger smarter not harder


Q: I do x and y happens which I didn't expect but I don't know how to figure out why. How do I debug and find my problem?
A:

This post has been edited by tlhIn`toq: 16 January 2013 - 07:29 AM

Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,412
  • Joined: 29-May 08

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 03:06 PM

The are Attributes you can add to methods so the debugger skips them.
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5437
  • View blog
  • Posts: 11,667
  • Joined: 02-June 10

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 03:11 PM

View PostAdamSpeight2008, on 16 January 2013 - 04:06 PM, said:

The are Attributes you can add to methods so the debugger skips them.

Such as... for example... listed at some link...
???
Was This Post Helpful? 0
  • +
  • -

#8 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3243
  • View blog
  • Posts: 10,882
  • Joined: 12-December 12

Re: Skip code when debugging (VS 2012)?

Posted 16 January 2013 - 03:19 PM

DebuggerStepThrough
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1