use CAS demand or not?



Hi,

If CAS policy is setup to deny an assembly ANC the permission
FileIOPermission, then if the assembly attempts to do File IO, the .NET
FW assembly that handles file IO should catch it, right? It shouldn't
be necesarry to put a check for FileIOPermission in the assembly
itself, and would seem to degrade performance because the check is
already going to be done further down the call stack, but the .NET FW
assembly. Plus any assembly wanting to do naughty file IO would just
skip its own demand anyway?

Or is it better to be explicit about what permissions an assembly
needs, and put an attribute in the assembly to show it does a demand on
FileIOPermission? (even though it's redundent).

Thanks,

Jon Paugh

.



Relevant Pages

  • Re: FileIOPermission question
    ... because I have no permission to access the files on this computer. ... to conclude if I test the file access with the FileIOPermission class, ... bool bHasAccess = true; ... If you inspect the exception that is occurring in the second try...catch ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Declarative FileIOPermission and variable directories
    ... but I was putting a FileIOPermission at the assembly level as ... > Is there a reason why you cannot use programmatic permission check instead ... >> Anyone else have a thought on specifying directories for a permission ...
    (microsoft.public.dotnet.security)
  • Re: FileIOPermission question
    ... because I have no permission to access the files on this computer. ... to conclude if I test the file access with the FileIOPermission class, ... bool bHasAccess = true; ... If you inspect the exception that is occurring in the second try...catch ...
    (microsoft.public.dotnet.languages.csharp)
  • Help - How am I misusing FileIOPermission?
    ... FileIOPermission, but can't seem to get it to work. ... See my sample app below, for an app that tries to demand a permission ... udeDirs, SearchOption searchOption) ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Help - How am I misusing FileIOPermission?
    ... FileIOPermission, but can't seem to get it to work. ... See my sample app below, for an app that tries to demand a permission ... udeDirs, SearchOption searchOption) ...
    (microsoft.public.dotnet.general)