Re: .net config help

From: Stephen McCloskey [MSFT] (stemccl_at_online.microsoft.com)
Date: 06/24/03

  • Next message: Stephen McCloskey [MSFT]: "Re: how to programatically give assembly loaded from network the same trust as those loaded from local host?"
    Date: Mon, 23 Jun 2003 15:10:29 -0700
    
    

    In the .NET Framework 1.0 and 1.1 there is no way to catch this exception
    because it occurs outside the scope of your application. When you perform a
    RequestMinimum, you are basically telling the CLR not to start your
    application if it is not granted the permissions that you specified. As
    such, there is no way for your app to catch the exception because it is not
    even allowed to execute. Anytime your app generates a PolicyException, you
    will have this problem.

    Stephen

    "john" <nospam@sorry.com> wrote in message
    news:03fa01c33949$25581030$a501280a@phx.gbl...
    > i have create a application that reads and writes to a
    > file with a click of either a write or a read button. I
    > have uploaded it my server for the zero deployment feature
    > and i have added the .net config permissions for fileIO
    > read and write. When i go to the site the application
    > does what i expect. Now then the problem is when i take
    > away one of these permissions for fileIO say my write
    > permission, and add these two lines to my AssemblyInfo.vb
    > file
    > <Assembly: Security.Permissions.FileIOPermission
    > (Security.Permissions.SecurityAction.RequestMinimum,
    > Read:="C:\myTest.txt")>
    > <Assembly: Security.Permissions.FileIOPermission
    > (Security.Permissions.SecurityAction.RequestMinimum,
    > Write:="C:\myTest.txt")>
    >
    > and then when i try and run the project from the zero
    > deployment i get this err/message box.
    >
    > JUST-IN-Time Debugging
    > An exception 'System.Security.Policy.PolicyException' has
    > occurred in IEExec.exe
    > then i gives me 3 Possible Debuggers.
    >
    > my question is this is there a way to have a message box
    > come up for the user instead of this just-in-time debugger
    > box. and have the message box state something to the
    > effect of the application needs x,y,z permissions to run.
    > and the application only found x,y. please blah blah blah.
    >
    > if you are having a hard time understanding what i'm
    > trying to say PLEASE tell me.. I will think of another way
    > to put it.
    >
    > thank you.
    > for any help.
    > cheers.
    > john
    >
    > and


  • Next message: Stephen McCloskey [MSFT]: "Re: how to programatically give assembly loaded from network the same trust as those loaded from local host?"
  • Quantcast