Home All Groups Group Topic Archive Search About

fileiopermission error

Author
18 Aug 2005 12:21 PM
ahmed khairy
I recently developed a web based application however each time i run it frmo
my web browser and attempt to write a file to my local machine i get the
errror:
"Request for the permission of type
'System.security.permissions.FileIOPermission, mscorlib, Version =
2.0.0.0...................failed'"
many thanks...

Author
18 Aug 2005 1:06 PM
Nicole Calinoiu
Under default CAS (code access security) policy, applications run from the
internet or intranet are not granted permissions to the file system.  There
are several ways around this:

1.  Change the CAS  policy on the client machines so that your assembly is
granted the FileIOPermission it needs.  (See
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx and
http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx for details.)

2.  Use isolated storage instead, limited subsets of which are permitted
under default policy for code running from these zones.

3.  If you're running from the intranet zone, use SaveFileDialog to write
the file.  This requires only FileDialogPermission\Save, which is included
in the default intranet zone grant (but not the default internet zone
grant).



Show quoteHide quote
"ahmed khairy" <ahmedkha***@discussions.microsoft.com> wrote in message
news:EEFE68B9-26C9-4ED3-8C75-89DCCDF269FA@microsoft.com...
>I recently developed a web based application however each time i run it
>frmo
> my web browser and attempt to write a file to my local machine i get the
> errror:
> "Request for the permission of type
> 'System.security.permissions.FileIOPermission, mscorlib, Version =
> 2.0.0.0...................failed'"
> many thanks...