Security (How Do I in C#)
This page links to help on widely used security and deployment tasks. To view other categories of popular tasks covered in Help, see How Do I in C#.
General
Security in Visual Studio
Provides an understanding of secure coding techniques.Code Access Security Basics
Provides code access security concepts in order to write effective applications targeting the common language run time.Microsoft Security Developer Center
Provides up-to-date security issues that help you develop secure code.Security Policy Best Practices
Explains basic administration concepts and describes some of the best practices to use when administering code access security policy.
Code Access and Permission Sets
How to: Use Data Protection
Provides procedures to encrypt or decrypt in-memory data or a file or stream by using data protection.How to: Add Custom Permissions to Security Policy
Provides a procedure to add a custom permission to security policy.How to: Enable Internet Explorer Security Settings for Managed Execution
Provides a procedure to enable Internet Explorer security settings.How to: Request Minimum Permissions by Using the RequestMinimum Flag
Provides an example that requests FileIOPermission using the RequestMinimum flag.How to: Create GenericPrincipal and GenericIdentity Objects
Provides an example on how to use the GenericIdentity class together with the GenericPrincipal class to create an authorization scheme that exists independent of a Windows NT or Windows 2000 domain.How to: Create a WindowsPrincipal Object
Provides two ways to create a WindowsPrincipal object, depending on whether code must repeatedly perform role-based validation or must perform it only one time.How to: Perform Imperative Security Checks
Provides an example that uses an imperative check to make sure that a GenericPrincipal matches the PrincipalPermission object.How to: Refuse Permissions by Using the RequestRefuse Flag
Provides an example that uses RequestRefuse to refuse FileIOPermission from the CLR security system.How to: Request Permission to Access Unmanaged Code
Provides an example that shows how to request permission to access unmanaged code.How to: Request Permission for a Named Permission Set
Provides an example that shows the syntax to request permission for a named permission set.How to: Request Optional Permissions by Using the RequestOptional Flag
Provides an example that requests FileIOPermission using the SecurityAction.RequestOptional flag, indirectly refusing all other permissions.How to: Store Asymmetric Keys in a Key Container
Demonstrates how to create an asymmetric key, save it in a key container, retrieve the key later, and delete the key from the container.How to: Add Assemblies to Security Policy Using Caspol.exe
Explains how to add an assembly that implements a custom security object to the fully trusted assembly list.How to: View Code Groups Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to view a simple list of code groups that belong to a policy level, or a list that includes the names and descriptions of the code groups.How to: Modify Permissions in a Permission Set
Explains how to use the .NET Framework Configuration tool (Mscorcfg.msc) to modify a permission in a permission set.How to: Add Permissions to a Permission Set
Explains how to use the.NET Framework Configuration tool (Mscorcfg.msc) to add a permission to a permission set.How to: Suppress Policy Change Warnings Using Caspol.exe
Explains how to Suppress Policy Change Warnings Using Caspol.exe.How to: Change Membership Conditions for a Code Group
Explains how to use Mscorcfg.msc to change membership conditions relative to code groups.How to: View Code Groups and Permission Sets Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to list all the code groups an assembly belongs to.How to: Administer Security Policy for Nondefault Users Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to administer a user policy for a user other than the current user.How to: Change Permission Sets Associated with an Existing Code Group
Explains how to use Mscorcfg.msc to change permission sets.How to: Analyze Problems with Assembly Permissions Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to troubleshoot problems that could cause an assembly to not run or to access protected resources or run when it should not.How to: View Permission Sets Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to list the permission sets that belong to all policy levels or to a single policy level.How to: Undo Policy Changes Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to recover the last computer, user, or enterprise policy before the change was made.How to: Import a Permission by Using an XML File
Provides an example that shows how the information for a permission might appear in the XML file.How to: Return to the Default Security Policy Settings Using Caspol.exe
Explains how to return to the Default Security Policy Settings Using Caspol.exe.How to: Add Code Groups Using Caspol.exe
Explains how to add code groups using Caspol.exe.How to: Override the Caspol.exe Self-Protection Mechanism
Explains how to override the self-protection mechanism, if it is required.How to: Create Code Groups
Explains how to create code groups using Mscorcfg.msc.How to: Disable Concurrent Garbage Collection
Explains how to use the <gcConcurrent> element to specify how the runtime should run garbage collection.How to: Import a Code Group by Using an XML File
Provides an example that shows how information for a code group and its associated membership condition and permission set might appear in an XML file.How to: Create a Publisher Policy
Provides an example that shows a publisher policy file that redirects one version of myAssembly to another.How to: Remove Code Groups Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to remove code groups from code group hierarchies.How to: Change Permission Sets Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to replace the original permission set with the new set specified in the XML file.How to: Remove Permission Sets
Explains how to use the .NET Framework Configuration tool (Mscorcfg.msc) to remove a permission set at a particular level.How to: Create Permission Sets
Explains how to use the .NET Framework Configuration tool (Mscorcfg.msc) to create a permission set for a particular level and associate it with a new or existing code group.How to: Make Code Groups Exclusive or Level Final
Explains how to use Mscorcfg.msc to make the new code group exclusive or level final.How to: Add an Assembly to the Policy Assemblies List
Explains how to use the .NET Framework Configuration tool (Mscorcfg.msc) to add the assembly to the fully trusted assembly list.How to: Import a Permission Set by Using an XML File
Provides an example that shows a permission set and a permission inside an XML file.How to: Locate Assemblies by Using DEVPATH
Provides an example that shows how to cause the runtime to search for assemblies in directories specified by the DEVPATH environment variable.How to: View Security Policy Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to view the security policy code group hierarchy, and a list of known permission sets for all policy levels or for a single policy level.How to: Add Permission Sets Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to add permission sets to a code group.How to: Change Code Groups Using Caspol.exe
Explains how to use the –chggroup option of the Code Access Security Policy tool (Caspol.exe) to change the name, membership condition, permission set, flags, or description of a code group.How to: Turn Security On and Off Using Caspol.exe
Explains how to use the Code Access Security Policy tool (Caspol.exe) to turn security on and off.How to: Remove Permissions from a Permission Set
Explains how to use the .NET Framework Configuration tool (Mscorcfg.msc) to remove a permission from a permission set.How to: Perform Common Security Policy Tasks Using the .NET Framework Configuration Tool (Mscorcfg.msc)
Explains how to use the .NET Framework Configuration tool (Mscorcfg.msc) to configure security policy to suit your needs.
Additional Resources
Microsoft Security Developer Center
Contains many articles and resources about how to develop secure applications.Visual Studio 2008 Developer Center
Contains many articles and resources about how to develop applications that use Visual Studio 2008. This site is updated regularly with new content.Visual C# Developer Center
Contains many articles and resources about how to develop C# applications. This site is updated regularly with new content.Microsoft .NET Framework Developer Center
Contains many articles and resources about how to develop and debugging .NET Framework applications. This site is updated regularly with new content.
See Also
Concepts
Change History
Date |
History |
Reason |
---|---|---|
September 2008 |
Removed links to obsolete topics. |
Content bug fix. |