NetCodeGroup Class
Grants Web permission to the site from which the assembly was downloaded. This class cannot be inherited.
For a list of all members of this type, see NetCodeGroup Members.
System.Object
System.Security.Policy.CodeGroup
System.Security.Policy.NetCodeGroup
[Visual Basic] <Serializable> NotInheritable Public Class NetCodeGroup Inherits CodeGroup [C#] [Serializable] public sealed class NetCodeGroup : CodeGroup [C++] [Serializable] public __gc __sealed class NetCodeGroup : public CodeGroup [JScript] public Serializable class NetCodeGroup extends CodeGroup
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Remarks
Code groups are the building blocks of code access security policy. Each policy level consists of a root code group that can have child code groups. Each child code group can have its own child code groups; this behavior extends to any number of levels, forming a tree. Each code group has a membership condition that determines if a given assembly belongs to it based on the evidence for that assembly. Only code groups whose membership conditions match a given assembly, along with their child code groups, apply code access security policy.
NetCodeGroup has the same merge semantics as that of UnionCodeGroup; it forms the union of the PolicyStatement objects of all matching child code groups and the PolicyStatement it generates from the input Url evidence. However, NetCodeGroup returns a permission set that contains a dynamically-calculated WebPermission that grants connect access to the site from which the code is run; UnionCodeGroup only returns a static permission set.
Access is only granted for the protocol over which the code was run, with the exception that code run over the HTTP protocol is granted access for both the HTTP and HTTPS protocols. For example, code from http://www.fourthcoffee.com/1/2/app.exe is granted permission to connect to http://www.fourthcoffee.com/* and https://www.fourthcoffee.com/*, but code from https://www.fourthcoffee.com/1/2/app.exe only gets permission to connect to https://www.fourthcoffee.com/*. This is done to ensure that an assembly cannot communicate over a less secure protocol than the one from which it was run. If an assembly could communicate over a less secure protocol, it would violate the user's expectation regarding the security of any information transmitted by that assembly.
Requirements
Namespace: System.Security.Policy
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: Mscorlib (in Mscorlib.dll)
See Also
NetCodeGroup Members | System.Security.Policy Namespace | Code Groups