Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FileIOPermission

0 views
Skip to first unread message

Ayende Rahien

unread,
Jun 12, 2004, 7:05:52 AM6/12/04
to
I've just run into a constant problem that I've with this permission.
I want to declare that I need All permissions to %APP_DATA%\<App_Name>
for the assembly, but there seems to be no way to do this.
How can I fix this while avoiding using:
Unrestricted=true ?

I don't need any access whatsoever to any other part of the filesystem, btw.

Nicole Calinoiu

unread,
Jun 12, 2004, 2:34:40 PM6/12/04
to
Ayende,

How about using the FileIOPermission constructor that allows you to specify
the file access type and the path. You'll probably want to use
FileIOPermissionAccess.AllAccess.

HTH,
Nicole


"Ayende Rahien" <Aye...@nospam.com> wrote in message
news:OeEPqTG...@tk2msftngp13.phx.gbl...

Fernando Vicaria [MSFT]

unread,
Jun 15, 2004, 12:22:28 PM6/15/04
to
Hi,

If I understood it right you want to demand this permission at runtime...
You could do this with an imperative security demand:

string pathApp = AppDomain.CurrentDomain.BaseDirectory;
FileIOPermission fp = new
FileIOPermission(FileIOPermissionAccess.AllAccess, pathApp);
fp.Demand();

Regards,
Fernando


"Ayende Rahien" <Aye...@nospam.com> wrote in message
news:OeEPqTG...@tk2msftngp13.phx.gbl...

0 new messages