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

G

Guest

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!
 
B

Bruce Barker

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top