Code groups is the building block of code access security policy. each policy level includes a root code group with a child code group. each child code group can have its own child code groups. this behavior can be extended to any level to form a tree. each code group has a membership condition that determines whether a given Assembly belongs to it. This judgment is based on the evidence given by the Assembly. only the code groups that membership condition can match with a given assembly can apply policy to itself and their child code groups.
Firstmatchcodegroup
==================================
The security policy is defined by the union of the policy statement of a code group and the first matched child code group. This class cannot be inherited.
Like any other code group, firstmatchcodegroup applies the policy only when its membership condition matches the evition provided by an assembly. if there is a match, he tests the membership condition of each child in sequence until the first match is found to stop. the result of firstmatchcodegroup is the union of the root code group and the policy statement of the first matched child code group.
Firstmatchcodegroup aims to help the Programming Application of the application domain host to set the Domain Policy.
Unioncodegroup
================================
It indicates that the policy statement isPolicy Statement of the current codegroupAndAll of its matched policy statement for child code groupsSuch a code group. This class cannot be inherited.
Unioncodegroup is the most common type of code group. the policy statement of all matched child code groups (and the code groups of children) are combined with the permission set of the matched parent code group. therefore, if its membership condition matches, this code group forms the union of its policy statement and all its policy statement with the child code group that evidence matches.
Unioncodegroup code groups are the code groups created by the caspol utility (see code access security policy tool (caspol.exe) and. net Framework Configuration tool (see. net Framework Configuration tool (mscorcfg. MSC )).
Unioncodegroup code groups is the code groups created by caspol utility. For more information, see the following two links: code access security policy tool (caspol.exe) Net Framework Configuration tool (mscorcfg. MSC)
Source:
Unioncodegroup
Http://msdn.microsoft.com/en-us/library/system.security.policy.unioncodegroup.aspx
Firstmatchcodegroup
Http://msdn.microsoft.com/en-us/library/system.security.policy.firstmatchcodegroup.aspx