views:

770

answers:

2

Using Visual Studio 2008 SP1 and a VB.NET project; I have some code which i cannot step into. The Immediate Window shows the message "Stepping over method without symbols 'Some.Namespace.Here'"

How can i make sure the method always has symbols?! I need to step into every line of code. I am pressing F8 (which is "Step Into" in VS2008, from memory i think it used to be F11 in VS2005).

This debugger stuff has always confused me: At the Solution level Property Pages i see a configuration dropdown with 4 values: Active (Debug), Debug, Release, All Configurations. - currently set to "Active (Debug)" At the Project level, i see a configuration dropdown with 2 values: Debug, Release. - currently set to "Debug"

A: 

If the namespace in question is a third party dll that didn't come with the symbols (pdb file) then this will occur. In order to "step into" the symbol file is needed.

If it's your own code then you would just need to double check that your symbol files exist. Having it set to debug at the project level should do this.

klabranche
Yes, it's my own code, and i have set it to "Active (Debug)" at the Project level (and also the Solution level, as described in my initial question).I can see the .pdb files, in fact i deleted them manually and recompiled again so they get produced afresh.I expect both the frm.Show() and frm.Focus() method to step into frm_Activated event, as i press F8, but this does NOT happen. I have to put a break-point manually in this event.
joedotnot
+1  A: 

I know this is an old question, but are you perhaps using yield functionality in a method that returns an IEnumerable?

For example (contrived):

public IEnumerable<object> GetObjects(IEnumerable<object> objects)
{
    foreach(var obj in objects)
        yield return obj;
}

I run into this in my unit tests often, but due to lazy evaluation, yield statements don't process until it is necessary. One way to force enumeration is to tack a .ToList() to the calling statement for example, though you wouldn't want to do that permanently unless the call is perhaps a test for some functionality where the enumeration itself isn't important.

So doing the following should result in enumeration:

GetObjects(new List<object>()).ToList();

In short, if you're calling a method that requires enumeration, but then never enumerate the result, you will get that error in the output. This could happen with LINQ statements as well, like .Select.

Edit: Didn't notice that it was a VB.NET project, but I'm pretty sure the principle still stands.

McMuttons