Posted on: 5/22/2013 2:46:28 AM | Views : 250

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,
...

Go to the complete details ...