Debugging PIAB applicaitons

May 31, 2007 at 2:20 PM
Since the Policy Injection Application Block uses Remoting under the covers, it makes it very difficult to debug clients of the app blcok, because instead of direcctly debugging an object (that is created via the Create method), I debug the transparent proxy instead.
Is there any solution to this problem?
May 31, 2007 at 4:16 PM
I haven't had a problem debugging the methods being intercepted. The targeted object methods still get called and can be debugged in the IDE, etc.

Debugging the handlers in the handler pipeline and unit testing the various scenarios is more of a challenge, but I think this is the nature of AOP.

Do you have a particular issue / example?




David Hayden
Microsoft MVP C#
May 31, 2007 at 8:39 PM
For example, when you pause the mouse on a field/property of the transparent proxy, you wouldn't see the value of it (in the IDE).
The real problems, regarding debugging, comes when you inherit ContextBoundObject, but that's not the case here.
Anyway, the PIAB would have been great if it wasn't for the fact that you need to inherit MarshalByRefObject.
Also, I think there might be a performance issue as well (due to the handlers and so).
Would you agree?
Do you think this application block is practical?
May 31, 2007 at 10:38 PM
I find the block very practical. The small performance hit that we have noticed is well worth it. There are also other alternatives being worked on currently that will remove the requirement for MarshallByRefObject. PostSharp4EntLib looks very promising in my opinion.
Jun 2, 2007 at 7:06 AM
I can see your issues with debugging; unfortunately, you'll get the same issues any time a proxy is present, transparent or otherwise.

We had one interesting suggestion to build a debugger visualizer to get around this issue. It'll definately be considered for whenever we do another entlib release.