Welcome to MSDN Blogs Sign in | Join | Help

Why Can't I See Extended SecurityException Information?

The v2.0 SecurityException is chock full of debugging goodness -- for trusted code that is.  In some cases you might not see all the extended error information.  The reason is that before writing extra security information into the output of ToString(), the SecurityException will demand ControlEvidence and ControlPolicy.  If that demand fails, it omits:

  • First failing permission
  • Demanded permission
  • Granted set
  • Refused set
  • Denied set
  • PermitOnly set
  • Failing assembly
  • Failing method
  • URL

This might come up if you're hosting partial trust code in a sandboxed domain, and at the domain boundary you catch and log exceptions.  In your log, the SecurityException probably won't have the information needed to help track down the real issue.  In that case, you'll need to have FullTrust code do the ToString operation, and also make sure to Assert ControlEvidence and ControlPolicy so that the demand does not fail when it hits the partial trust domain boundary.  Of course, you'll want to make sure that the partial trust code doesn't get this string back and cannot read from the log file.

Published Thursday, March 23, 2006 7:00 AM by shawnfa
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# MSDN Flash Resources - 13 Apr 06

Thursday, April 13, 2006 8:09 AM by Robert Burke's Weblog












Web Resources



 

[Default] April MSDN Magazine
Get a handle on...

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker