views:

469

answers:

1

Update: After more digging this seems to be an issue with static methods and member variables. I found this post on MSDN forums, but no answer.

I am writing a C# WinForms app(.Net 2.0) with a mixed mode dll all in the same solution. When I step into native code while debugging I am unable "watch" many of the pointer variables. This seems to be an odd behavior because some of the pointers are watchable(I guess that is a word :))

for example:

Connection* Connection::Instance()
{
    if (innerConnection == NULL)
    {
        innerConnection = new Connection();
    }

    return innerConnection;
}

While stepping through this method innerConnection is not available to me. The value for this in the watch window is "error: identifier 'innerConnection' out of scope". Inner connection should not be out of scope here.

Also in this example in the "Autos" window "this" has

The C# project is set as the startup project and it references the C++ dll project(All in the same solution). I have enable native debugging in the C# project, and set debug mode to Auto in the C++/CLI project. I am using Visual Studio 2005

A: 

In my case (native EXE --> mixed DLL --> managed assembly (all Visual Studio 2008)) I had to set the debug mode of the executable to 'Mixed'. With the default 'Auto' setting I could not step into the managed assembly.

TheArtTrooper