views:

433

answers:

3

Hey guys, just installed on my Mac Snow Leopard OSX:

Mono 2.6 and Monodevelop 2.2

I've created a simple C# Console App:

public static void Main (string[] args)
    {
        Console.WriteLine ("Hello World!");
        Console.Read();
    }

When I start to type "Console" intellisense works perfectly.

When I run the app in Debug mode, breakpoints hit as expected.

However, while debugging with breakpoints, if I hover over "Console" it says "Unknown Identifier"

When I try and use the immediate window, nothing works. Anything I type just says "Unknown Identifier."

Anyone know what's going on?

cheers!

+3  A: 

Please file a bug report.

mhutch
is this a known bug? I don't know if it is a bug, might be something I've done...? Does anyone know what I'm talking about? I'm totally new to Mono...?
andy
It's know to be an issue with types that have not yet been loaded by the debuggee. Is your breakpoint before the program calls Console?
mhutch
is there a way to explicitly load types into the debugger...?
andy
Not yet, no. This isn't something we can fix in MonoDevelop either; it needs to be fixed in the debugger in the Mono runtime.
mhutch
I dug a bit deeper and filed a bug for you: https://bugzilla.novell.com/show_bug.cgi?id=570855
mhutch
+2  A: 

Try this and compiling with the -debug flag on:

public static int Main (string[] args) 
{ 
    Console.WriteLine ("Hello World!"); 
    Console.Read(); 
    return 0; // Place breakpoint here
}

If that works then try this:

public static void Main (string[] args) 
{ 
    int dummy;
    Console.WriteLine ("Hello World!"); // Place breakpoint here
    Console.Read(); 
}
fupsduck
thanks fupsduck, it'll try that out and get back to you. cheers!
andy
did you try compiling with the -debug flag on?
fupsduck
hmm... I think so. I clicked on the debug button, not the run button. I'll try tonight as my Mac's at home. cheers dude
andy
if it works with breakpoint on return 0, then try on Console.Read(). If that works but not when on Console.WriteLine() add int dummy; to top of file to start break on Console.WriteLine().
fupsduck
+1  A: 

For what it's worth, I can reproduce exactly what you're describing (Mac OS X, same versions, similar Hello World code, using a breakpoint on the first code line). However, as soon as I "Step Over" to the next line, the popup shows up correctly for "Console". As such, this behavior seems acceptable (at least to me).

fmr
hmm... thanks fmr, that's good to know. My Mac's at home, but as soon as I get in tonight I'll give it another look. Could you tell me if you can also use the Immediate window ok? cheers!
andy
yes, same behavior for Immediate window. As soon as "Step Over" is performed, you can evaluate "Console.CapsLock" for example.
fmr
Like I said in the comments to my answer, it's know to be an issue that MD is currently only able to access types after they've been loaded by the debuggee.
mhutch