Diagnosing why DebuggerTypeProxy attributes are not working
Asked Answered
P

5

6

I'm trying to make a wrapper for a COM object easier to work with when debugging by adding a DebuggerTypeProxy attribute - the attribute appears to work some of the time (when running unit tests etc...), but doesn't work when I'm actually debugging the target process and I don't know why:

  • I've checked to make sure that the correct assembly is being loaded in the modules window, and even disassembled the assembly to make sure that its the correct one and has the correct attributes etc...
  • I've tried making my debug proxy classes public, but that made no difference.
  • I've used reflection in the Immediate window while debugging my external process and seen that the attribute I've defined appears to be correct.

Other classes that have DebuggerTypeProxy attributes defined on them (in the same assembly) seem to be working fine - I just can't figure out why

  • Is there any other reason why my DebuggerTypeProxy attribute wouldn't be working in the target process?
  • Are there any other ways of debugging / troubleshooting the reason why the attribute is having no effect?
Papacy answered 2/8, 2010 at 6:4 Comment(0)
L
3

I had this same problem and found the answer was to uncheck the "Show raw structure of objects in variables windows" in Tools > Options > Debugging > General settings.

Lipocaic answered 1/10, 2010 at 5:58 Comment(0)
A
1

Given that you are working on Visual Studio 2010, my suspicion is that the Embed Interop Types feature is causing this problem. Try turning off Embed Interop Types and repeating your solution.

  • Go to the References item in Solution Explorer
  • Select every reference
  • Bring up the property grid
  • Change "Embed Interop Types" to false
  • Rebuild

Then repeat your scenario.

Auriga answered 26/8, 2010 at 16:34 Comment(4)
Ah - sorry, I miss-tagged the question VS2010, but this is actually happening on VS2008. (sorry)Papacy
@Kragen somehow missed your comment. What language are you using?Auriga
The debugger type proxy etc... are all written in C#Papacy
@Kragen, does this happen only when you attach to the process or does it also happen for F5?Auriga
E
1

In Asp.net application, the problem was in code access security. When application run with full trust, all was OK. With partial trust - DebuggerTypeProxy attributes are not working

Earthward answered 14/10, 2011 at 7:47 Comment(0)
D
0

I have also stumbled on this issue.

DebuggerTypeProxy was not working correctly in Medium Trust.

Issue was resolved by moving DebuggerTypeProxy class from being a private nested class (in a container class for which it is a debugger proxy) to being an internal class directly under namespace (not nested).

Just in case someone else also stumbles on the same issue.

Drosophila answered 5/12, 2013 at 13:13 Comment(0)
S
0

Use Managed Compatibility Mode should be unchecked in Tools, Options, Debugging, General.

Sateia answered 10/1, 2018 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.