Re: Security Exception thrown from non-executed code? WHY WHY WHY???
From: Sijin Joseph (sijinNOSPAMdotnet_at_hotmail.com)
Date: 10/14/04
- Next message: Rua Haszard Morris: "Re: control data binding not happening when data entered from app"
- Previous message: Sijin Joseph: "Re: MIME Settings"
- In reply to: Kelvin: "Security Exception thrown from non-executed code? WHY WHY WHY???"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 09:24:56 +0530
What i think may be happening is that the security check is being
performed before the method gets JIT compiled so in that case it will be
scanned for security exceptions before the JIT compilation begins for
the method.
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
Kelvin wrote:
> Hi all,
>
> This is very strange.
>
> The ".Net Configuration" - "RunTime Security Policy" - "Permission
> Sets" used by my smart client includes all the permissions (not full
> trust).
>
> In the code, I notice that the call "if(HttpContext.Current == null)"
> always throws a Security exception.
>
> Ok, fine, then I don't call it. BUT, the code would still throw an
> exception even thought that line is not executed. For example:
>
> int i=0;
> if(i > 10) { // This block will never execute right?
> if(HttpContext.Current == null) {
> MessageBox.Show("It is null");
> }
> }
>
> It still throws an exception at "HttpContext.Current == null"!
>
> BUT if I put "if(HttpContext.Current == null)" into another method, it
> works fine. For example:
>
> int i=0;
> if(i > 10) { // This would work!
> if(CheckHttpContext()) {
> MessageBox.Show("It is null");
> }
> }
>
>
> public bool CheckHttpContext()
> {
> return HttpContext.Current == null;
> }
>
> Isn't it strange? By the way, does anyone know the different between
> "Full Trust" and a Permission Sets that includes all the permission?
>
> Thanks in advance!
>
> Kelvin
- Next message: Rua Haszard Morris: "Re: control data binding not happening when data entered from app"
- Previous message: Sijin Joseph: "Re: MIME Settings"
- In reply to: Kelvin: "Security Exception thrown from non-executed code? WHY WHY WHY???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|