Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

HttpHandler + Medium Trust Level + GAC + PermissionSet

$
0
0

Hi,

I implement a custom IHttphandler and installed it to GAC. The implementation for ProcessRequest like following is used to check whether web site is in medium trust level,

public void ProcessRequest(HttpContext context)

{

  try

  {

      new PermissionSet(PermissionState.Unrestricted).Demand();

  }

  catch(SecurityException) { }

}

Then I create a new WebSite, set trust level to Medium.  Demand() does NOT throw SecurityException with framework 2.0&3.5, but it DOES with framework 4.0.

How can I check trust level in HttpHandler with .net framework 2.0 or 3.5?

Thanks,


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>