demand assembly security

  • Thread starter Thread starter sazonov dmitry
  • Start date Start date
S

sazonov dmitry

I started to use FxCop and it is a pain: code security.

FxCop told me to add minimum security and my code is not
working anymore.

now it crashing on
string machine = System.Environment.MachineName;

I tried to add

[assembly: EnvironmentPermission
(SecurityAction.RequestMinimum, Unrestricted=true)]

but it did not help. What should I do?

thanks
 
A few questions:

1. Is the RequestMinimum for Environment permission the only assembly-level
permission attribute in your assembly? If not, could you please post the
complete list?

2. Is this a library assembly that is being called from another
application? If so, could it be that this application (or any intermediary
library) lacks unrestricted EnvironmentPermission, either due to CAS policy
or assembly-level permission attributes?

3. Do any methods on the call stack apply a PermitOnly or Deny for any
permissions?
 
Back
Top