Re: FileIOPermissions issue - howto fix?

From: Michel Gallant (neutron_at_istar.ca)
Date: 07/19/03

  • Next message: Shmulik28_at_yahoo.com: "Re: FileIOPermissions issue - howto fix?"
    Date: Sat, 19 Jul 2003 14:34:07 -0400
    
    

    In the .NET CAS security manager, doesn't really matter what user permissions you
    have on that network share, the code-origin is queried first and it is LocalInternet
    in origin which by default has rather restricted code-execution permissions.
    The safest way to enable the file permissions you need is to use a code group
    based on strong-naming or Authenticode signature.
    Here is a walk-through with screen shots showing how to do it for strong-naming:
      http://www3.sympatico.ca/mitchg/dotnet/networkshare.html

     - Michel Gallant
       MVP Security

    <Shmulik28@yahoo.com> wrote in message news:OoWe0FiTDHA.1664@TK2MSFTNGP11.phx.gbl...
    > My application uses components and controls contained in a control library
    > which works fine on my home system. When I installed the application on our
    > local network a twork, one of the controls (A logging window with a
    > richtextbox
    > control and edit/save capabilities) disappears from the main form. When I
    > drag the "LogWindow" control from the toolbox and drop it on my form I
    > receive the following error message:
    >
    > "...The exception was "Request for the permission of type
    > System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0,
    > ..., failed.";
    >
    > Trying to debug this it appears that the culprit is the SaveFileDialog
    > component (if I comment out the code associated with this component in the
    > library, I can drop a "LogWindow" onto my form.
    >
    > I check permissions on the drive and either as myself, or logged-in as
    > administrator, have
    > full access to the drive.
    >
    > What I find perplexing is that I can drop and use a SaveFileDialog control
    > directly on my form, but if it is contained with a control in a library I
    > cannot.
    >
    > In order to temporarily fix this, I used the Security Adjustent Wizard and
    > set the trust level to "Full Trust" for the Local Intranet, but I only want
    > to do this until I can understand how to do it right.
    >
    > My questions are:
    >
    > 1) What application/assembly needs a trust level "boost" in order to drop a
    > control from a control library onto a form in VS2003 in design mode? Do I
    > need to do something with the mscorlib assembly? Or is there some attribute
    > I need to tag the user control library with in order to work in design mode
    > (I can understand that maybe the program wouldn't run without proper
    > permissions, but why can't I design the application?)
    >
    > 2) If I created a "group" with all the necessary privileges, how does my
    > program "execute" as under the elevated permissions, while allowing the user
    > to run other applications under their normal permissions - an example would
    > be helpful.
    >
    > Thanks!
    >
    >
    >
    >
    >


  • Next message: Shmulik28_at_yahoo.com: "Re: FileIOPermissions issue - howto fix?"

    Relevant Pages

    • Re: User Control Security on .Net 2.0
      ... we'll suggest design the security policy and ... help calculate the permissions our assemblies require.... ... Microsoft Online Support ... since the IE hosted winform control are hosted in Internet explore ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: folder permissions
      ... permissions, everyone has full control. ... Security tab, I added my security group, select everything BUT Full control, ... I have a folder on my server that will contain information scanned ...
      (microsoft.public.windows.server.general)
    • Re: access denied issue
      ... If the share permissions are read-only, they can not write any data. ... Change share permission to full control and configure the NTFS permissions ... Security is the same as on the "D" security ... machine and just using the system with mapped drives like in the old ...
      (microsoft.public.windows.server.security)
    • Re: folder permissions
      ... permissions, everyone has full control. ... Security tab, I added my security group, select everything BUT Full ... I have a folder on my server that will contain information ...
      (microsoft.public.windows.server.general)
    • RE: Event ID 524 even with network access OKd
      ... permissions to "Access this computer from the network" ... and the "Deny logon locally". ... Shortly after I accessed the Local Security Policy ...
      (microsoft.public.win2000.security)