Custom security permission exception error message
From: Marius Groenendijk ("Marius)
Date: 09/27/05
- Previous message: kevin.kenny_at_zygonia.net: "Re: Prevent access to advapi32.dll RevertToSelf()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 27 Sep 2005 15:58:50 +0200
Hello group!
We're planning to use strong naming for our app and this does indeed
work fine *if* the app has been registered for fulltrust (w/ caspol).
Trouble is if it's not *yet* fully trusted. Then, if the app starts
it bombs immediately with an *ugly* message which the average end-user
would not understand or appreciate (WTH does it mean?):
An unhandled exception of type 'System.Security.SecurityException' occurred
in ...
*or*
Common Language Runtime Debugging Services
Application has generated an exception that could not be handled.
...
Click OK to terminate the application.
Click CANCEL to debug the application.
During debugging the debugger doesn't even get as far as executing
a single line of our code - it's mscoree, on loading the app, that
issues the 'ugly' msg, right?
1) What can we do to try/catch this exception so that *we* can issue
our own 'friendly' msg?
2) What security permissions are required in AssemblyInfo (something
that FxCop also keeps complaining about).
3) How to ensure that once the app gets past 1) (fulltrust=OK) that
it gets the required privileges ( unmanaged code, R/W registry
access, R/W file io, ui, reflection )?
B.t.w. the app uses ADO.NET, JRO *and* JET
Looking forward to any replies which'll be greatly appreciated
Many thanks,
Marius.
- Previous message: kevin.kenny_at_zygonia.net: "Re: Prevent access to advapi32.dll RevertToSelf()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|