whytheq
whytheq

Reputation: 35557

How do I step into other class

This is really testing "there's no such thing as a stupid question"

Here is the console code:

class Program {

    static void Main(string[] args) {

        myClass cl = new myClass();
        cl.myMethod("world");

        Console.WriteLine("press [enter] to exit");
        Console.ReadLine();
    }
}

public class myClass {

    public void myMethod(string x) {
        Console.WriteLine("hello {0}", x);
    }
}

If I press F10 and step into Main and then keep pressing F10 why does it not step into myClass ?

Can I change my settings so it steps into other called classes?

Upvotes: 0

Views: 153

Answers (7)

Grant Thomas
Grant Thomas

Reputation: 45083

Because F11 is Step Into, F10 is Step Over.

Note that F11 can still seem to step over in certain circumstances, namely when working with properties and you've OKd Visual Studio to 'ignore' stepping into the body.

Upvotes: 1

TYY
TYY

Reputation: 2716

The F11 option will work (right way to step into). You can also set breakpoint in the class you want to step into and that will also work.

Upvotes: 2

Luis Filipe
Luis Filipe

Reputation: 8708

This is, somewhat, a real test :)

Press F11 instead of F10. Read more about debugging in this video and also here

Upvotes: 1

Hossein Narimani Rad
Hossein Narimani Rad

Reputation: 32481

F10: Step Over

F11: Step Into

Shift+F11: Step Out

Upvotes: 0

Petr Peller
Petr Peller

Reputation: 8826

According to hotkeys list the F10 does not step into. What you want is the F11.

Upvotes: 0

Freeman
Freeman

Reputation: 5801

F11 is your solution. It's for stepping in.

Upvotes: 3

Guffa
Guffa

Reputation: 700362

The F10 is the step over command, it doesn't step into methods that are called.

Use F11 to get the step into command, that does step into methods.

Upvotes: 0

Related Questions