Re: FileIOException, Need help please

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 05/14/05

  • Next message: Dominick Baier [DevelopMentor]: "Re: Writing ASP.NET errors to the NT Applicaion Event Log"
    Date: Sat, 14 May 2005 00:56:39 -0700
    
    

    Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,

    i would also suggest to not use the filename that is returned from the fileopen
    dialog but the FileStream..does not require that much permissions...

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > "Moe" <Moe@discussions.microsoft.com> wrote in message
    > news:3E8B6871-4DF4-4ABE-8E0F-065B7DC14CD7@microsoft.com...
    >
    >> I have a winForm control that contains an openFileDialog.
    >> I am using this control in a webForm by enbedding it using an
    >> <object>
    >> tag.
    >> I need to access some information about the file on the client.
    >> I strongly named my control assembly .
    >> I created a machine level permission set, and assigned FileDialog,
    >> FileIO
    >> and User interface permission.
    >> I created a code group under all_Code, associated my assembly's
    >> strong
    >> name
    >> to that group and assigned the permission set i created previously.
    > Not a great idea. It would be better to add the new group under the
    > appropriate zone group (usually intranet) in order to minimize the
    > potential impact of a compromise of your signing key.
    >
    >> I also added the following attributes to my assembly:
    >> [assembly:AllowPartiallyTrustedCallers]
    >> [assembly: FileDialogPermission(SecurityAction.RequestMinimum,
    >> Unrestricted
    >> = true)]
    >> [assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted =
    >> true)]
    >> [assembly: FileIOPermission(SecurityAction.RequestMinimum,
    >> Unrestricted =
    >> true)]
    >> I am having a file IO Exception while trying to retreive the FileName
    >> property of the openFileDialog.
    >>
    > It really shouldn't be getting that far. Given that you've specified
    > a
    > RequestMinimum for
    > unrestricted FileIOPermission, your assembly should not run at all if
    > this
    > permission is denied. Are you sure that you're attempting to run the
    > latest
    > version of the assembly?
    > That said, you'll still have a problem once you resolve the above
    > issue since the IE host won't resolve your assembly's strong name
    > until after the permissions grant is complete. For workarounds, see
    > http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx.
    >
    >> Any help will be very appreciate it.
    >>
    >> Thanks!
    >>


  • Next message: Dominick Baier [DevelopMentor]: "Re: Writing ASP.NET errors to the NT Applicaion Event Log"

    Relevant Pages

    • Re: Forcing Ownership of files
      ... >> without that right IF they have Full Control. ... > have explicit permission to do whatever they like with the content of ... > when I first tuned up here from a Novell server to a Windows 2000 server ... Now they are worried about security so ...
      (microsoft.public.win2000.active_directory)
    • Re: PM Security Issue
      ... gives me permission to open projects in Microsoft Project Professional. ... Categories control what you can do it to. ... in which I am a team member, and in which my resources are team members. ... When the My Projects category is included in the Project Managers group, ...
      (microsoft.public.project.pro_and_server)
    • Re: ISA Server Error
      ... from NETWORK SERVICE to Local Server for the logon. ... The default permission should be ... Administrators: Full Control ... make a rule change or anything. ...
      (microsoft.public.isa)
    • RE: IE Hosted UserControl - javascript interaction not working.
      ... To access public properties or invoke public methods of the control from ... Information window, select the checkbox before the 'Make assembly ... need assign the control assembly embeded in the web page the permission to ... Code Group' window, select the 'Create a new code group' option and type a ...
      (microsoft.public.dotnet.framework.windowsforms)
    • Re: ISA Server Error
      ... The default permission should be ... Administrators: Full Control ... should inherit the same permission (Administrators: Full Control, ... | Thread-Topic: ISA Server Error ...
      (microsoft.public.isa)