winform control hosted in IE, FileIO security exception. Please he

Discussion in 'ASP .Net' started by =?Utf-8?B?TW9l?=, May 12, 2005.

  1. 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.

    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.

    Any help will be very appreciate it.

    Thanks!
     
    =?Utf-8?B?TW9l?=, May 12, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?TW9l?=

    Bruce Barker Guest

    when winForms controls are hosted in IE they run in a sandbox with reduced
    permissions, no i/o allowed for instance.

    to raise the permissions of the winform object:

    1) supply a msi installer to install the object on the local machine, and
    set the permissions. then you must reference the object from the gac not
    your website

    2) convience your users to trust your site, and up the permissions for
    objects downloaded from your site (see caspol utility)

    -- bruce (sqlwork.com)




    "Moe" <> wrote in message
    news:...
    >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.
    >
    > 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.
    >
    > Any help will be very appreciate it.
    >
    > Thanks!
     
    Bruce Barker, May 12, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dGVycnlyZXk=?=

    IE hosted winform control not fully working

    =?Utf-8?B?dGVycnlyZXk=?=, Aug 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    482
    =?Utf-8?B?dGVycnlyZXk=?=
    Aug 20, 2005
  2. Replies:
    0
    Views:
    428
  3. Marco
    Replies:
    1
    Views:
    2,436
    Roedy Green
    Jan 28, 2006
  4. sharpfun23
    Replies:
    0
    Views:
    837
    sharpfun23
    Aug 29, 2006
  5. Scott Leonard

    Security Exception - Winform usercontrol hosted in ASP.NET

    Scott Leonard, Dec 3, 2004, in forum: ASP .Net Security
    Replies:
    2
    Views:
    282
    Scott Leonard
    Dec 22, 2004
Loading...

Share This Page