Justin
Justin

Reputation: 86789

Diagnosing why DebuggerTypeProxy attributes are not working

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:

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

Upvotes: 6

Views: 1010

Answers (5)

Maxence
Maxence

Reputation: 13329

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

Upvotes: 0

Stipo
Stipo

Reputation: 4606

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.

Upvotes: 0

aig
aig

Reputation: 11

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

Upvotes: 1

jnielsen
jnielsen

Reputation: 202

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.

Upvotes: 3

JaredPar
JaredPar

Reputation: 755317

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.

Upvotes: 1

Related Questions