Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

I can't get the DebuggerDisplay attribute to work in C# express. It works just fine in VB. I searched google and it seems like I'm the only person who has this problem. I can't find any relevant settings or anything.

 

Module Module1
   Sub Main()
       Dim var As New X 'Displays "Test" in the debugger.
   End Sub
End Module

<DebuggerDisplay("Test")> _
Class X
End Class

 

[CS]

class Program

{

static void Main(string[] args) {

X var = new X(); // Displays "{ConsoleApplication2.X}" in debugger

}

}

[DebuggerDisplay("Test")]

class X {}

[/CS]

Anyone have any ideas?

[sIGPIC]e[/sIGPIC]
Posted
I've been perplexed by this in the past. Mine is working now and i can't remember exactly which debugger options i had to change. I think you need to ToString() evaluation and JustMyCode enabled, give it a try.
  • Leaders
Posted
I found that if I disable "Unwind the call stack on unhandled exceptions" the debugger display attribute works correctly, along with a number of other minor problems (including the occasional inability to view instance members after an exception because the "this" pointer is not available). I think that this puts certain limitations on when you can edit and continue.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...