Custom security permission exception error message

From: Marius Groenendijk ("Marius)
Date: 09/27/05

  • Next message: Dominick Baier [DevelopMentor]: "Re: Prevent access to advapi32.dll RevertToSelf()"
    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.


  • Next message: Dominick Baier [DevelopMentor]: "Re: Prevent access to advapi32.dll RevertToSelf()"

    Relevant Pages

    • Re: Mobile Service & Auto Start
      ... The RegRestoreFile API is only supported by the object store-based registry. ... have never needed to write an app like this and I just figured ... So I have an exe that I start 5 min after I push a button. ...
      (microsoft.public.dotnet.framework.compactframework)
    • Searching for Exception tracker engine
      ... During debugging there is many times that I get Exception and tracking the ... error and finding origin (unit/line) code is useful. ... name) engine that when I included that with my app it reports unit/line ... Is there any lib that I include with app to detect exception errors line no ...
      (borland.public.delphi.ide)
    • Re: Ini File vs Registry
      ... How do you manage the settings? ... dollars in hacking the OS to introduce the concept of registry ... Hard to migrate app ... but increasingly desktop developers are fighting it out ...
      (microsoft.public.vc.mfc)
    • Re: VFP Updates?
      ... Account", which is what many users do, e.g. in company networks. ... WinXP limited accounts as well as Vista UAC is quite easy ... considerations for installing and running a VFP app in Vista. ... directory/folder IS), and you don't need to write to registry, I think ...
      (microsoft.public.fox.programmer.exchange)
    • Re: OT - Desktop Linux
      ... I want to delete the file, but let the app using it to continue ... But it keeps it in the main registry instead of creating a per user ... It's next to impossible to shift apps from disk to disk ... drives can be mounted at will at any mount point or even as a ...
      (alt.sports.basketball.nba.la-lakers)