Hi,
I use following code to check whether my assembly is in medium trust or full trust,
try
{
new PermissionSet(PermissionState.Unrestricted).Demand();
}
catch(SecurityException)
{
}
I also implement a custom IHttphandler and invoke code above. But even if I set my website as medium trust with .net framework 3.5, PermissionSet.Demand() does not throw SecurityException.
Strangely, it works fine with .net framework 4.0.
Is this a bug of .net framwork 3.5? or I should implement trust level checking by another way?
Thanks.