Re: Strange problem with FileIOPermission
From: Nicole Calinoiu (nicolec_at_somewhere.com)
Date: 08/31/04
- Next message: news.microsof.com: "Get Certificate"
- Next in thread: Shell: "Re: Strange problem with FileIOPermission"
- Reply: Shell: "Re: Strange problem with FileIOPermission"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 31 Aug 2004 11:39:32 -0400
When is the SecurityException thrown? When your forms assembly loads? When
a particular line of code is run (and if so, what's the line)?
"Shell" <shelld00d@yahoo.com> wrote in message
news:ch14mv$a72@odbk17.prod.google.com...
> Hi,
>
> I have a problem with the FileIOPermission attribute. Here's my
> situation:
>
> I've written a class in whose AssemblyInfo I've added the line
>
> [assembly: FileIOPermission(SecurityAction.RequestRefuse, All =
> @"c:\myOtherFolder")]
>
> I added the same line to the AssemblyInfo of a WinForms application.
>
>>>From what I figure, this means that both my class and forms app are
> requesting no access to 'myOtherFolder'. I checked with permview and it
> confirms that all access to these folders have been refused.
>
> Now the problem... when I run my app and instantiate the class, a
> security exception gets thrown:
>
> An unhandled exception of type 'System.Security.SecurityException'
> occurred in system.windows.forms.dll
>
> Additional information: Security error.
>
>
> It goes away if:
>
> a) I remove the line from my winforms assemblyinfo.cs, or
> b) I change RequestRefuse to RequestMinimum in my class.
>
> I can't seem to make sense of this. Any comments?
>
> [Disclaimer: This is my first step into CAS. Please forgive my
> ignorance. :)]
>
- Next message: news.microsof.com: "Get Certificate"
- Next in thread: Shell: "Re: Strange problem with FileIOPermission"
- Reply: Shell: "Re: Strange problem with FileIOPermission"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|