Re: Trust level required for AppDomain.CurrentDomain.UnhandledExcept



use these instruction to get the REAL reason:

http://www.leastprivilege.com/ViewingSecurityExceptions.aspx

permcalc is awkward and not very precise IMO

or

simply look at the docs ;)

they say

"SecurityPermission to add an event handler for this event. Associated enumeration: SecurityPermissionFlag.ControlAppDomain"

-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

I was trying to reduce the trust level in a web application. I am a
newbie at playing with trust levels.

<trust level="High" originUrl="" processRequestInApplicationTrust =
"true" /> We use a non-Gac dll in it that has this code:

AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(OnUhe);

I get an exception:
System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Is their a good way to get rid of the exception?
Is their a way from the documentation to tell what trust level is
required?


.



Relevant Pages

  • RE: BackgroungWork taske ended for no appearent reason
    ... If there was any exception thrown in your DoWork event handler, ... If the operation raises an exception that your code does not handle, ... RunWorkerCompleted event handler, where it is exposed as the Error property ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Combobox fun - "Specified argument was out of the range..."
    ... I tried disabling the event handler, ... exception, the combobox refills with Class.Property. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to catch custom errors raised in SP gracefully?
    ... I can't get the event handler ... to throw a new exception, ... Console.Writeline, or HttpResponse.Write, the error message from the event ... >>missing, FK violation etc), because if I purposely raise an error, I sure ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Exception handling suggestions
    ... Ok, if this is for a windows app, what is "main"? ... You can add the event handler anywhere, but it's best to do it as ... and it's usually where you set up global exception ... catch an exception unless you can take some substantial action ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: System.NullReference exception
    ... If an exception goes unhandled in a .NET 2.0 application, ... there is actually another source of UnhandledException: ... Application.ThreadException is used to add the event handler for handling UI ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)