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: 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)
  • InnerException > BackgroundWorker > MyApplication.UnhandledExcepti
    ... The event handler displays the message from the exception and from the inner ... Private Sub MyApplication_UnhandledException(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework)
  • 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)
  • CancelBatch and OLE Error 80040E20
    ... Intraweb controls--though I don't think that's relevant). ... I have written an event handler for the WillChangeRecord event that takes ... executes the stored procedure, then calls CancelBatch. ... Project Test.exe raised exception class EOleException with message 'OLE ...
    (borland.public.delphi.database.ado)