demand assembly security

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
 
N

Nicole Calinoiu

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top