views:

57

answers:

2

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?
+1  A: 

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.

JaredPar
Ah - sorry, I miss-tagged the question VS2010, but this is actually happening on VS2008. (sorry)
Kragen
@Kragen somehow missed your comment. What language are you using?
JaredPar
The debugger type proxy etc... are all written in C#
Kragen
@Kragen, does this happen only when you attach to the process or does it also happen for F5?
JaredPar
A: 

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.

jnielsen