Export (0) Print
Expand All
Expand Minimize

Troubleshooting Exceptions: System.Security.SecurityException

A SecurityException exception is thrown when a security error is detected.

Adjust the permission level of the assembly via the property page.

For more information, see SqlPermissionLevel.

Store application data in isolated storage.

Isolated storage is a data storage that provides isolation and safety by defining standardized ways of associating code with saved data. For more information, see Isolated Storage.

If using OpenFileDialog , use the OpenFile method to open or save a file.

This allows the application to perform in a partial-trust situation.

Make sure the application is reading and writing to existing event logs on the local computer.

The application may not have sufficient permissions to create logs on or write to non-local computers.

If calling unmanaged libraries, use equivalent managed libraries.

An equivalent API may exist in the Framework. For more information, see Troubleshooting Interoperability.

Use safe windows.

The UIPermissionWindow enumeration specifies the type of windows that code is allowed to use.

Allow users to print through the PrintDialog component.

This allows the application to perform in a partial-trust situation. For more information, see PrintDialog.

Print to the default printer.

This allows the application to perform in a partial-trust situation. You may be trying to access a printer to which you do not have rights.

Retrieve data from the same Web server from which it was deployed.

This allows the application to perform in a partial-trust situation. For more information, see Deploying XML Web Services.

Retrieve data from a WebService located on the same Web server from which it was deployed.

For more information, see Deploying XML Web Services.

When deploying an Office solution, check to make sure you have fulfilled all necessary security requirements.

For more information see Security Requirements to Run Office Solutions.

If an assembly implementing the custom security object references other assemblies, add the referenced assemblies to the full trust assembly list.

For more information, see Code Access Security Policy Tool (Caspol.exe) and Configuring Security Policy Using the Code Access Security Policy Tool (Caspol.exe).

Community Additions

ADD
Show:
© 2014 Microsoft