ApplicationId Class
Contains information used to uniquely identify a manifest-based application. This class cannot be inherited.
Assembly: mscorlib (in mscorlib.dll)
| Name | Description | |
|---|---|---|
![]() | ApplicationId(Byte[], String, Version, String, String) | Initializes a new instance of the ApplicationId class. |
| Name | Description | |
|---|---|---|
![]() | Culture | Gets a string representing the culture information for the application. |
![]() | Name | Gets the name of the application. |
![]() | ProcessorArchitecture | Gets the target processor architecture for the application. |
![]() | PublicKeyToken | Gets the public key token for the application. |
![]() | Version | Gets the version of the application. |
| Name | Description | |
|---|---|---|
![]() | Copy() | Creates and returns an identical copy of the current application identity. |
![]() | Equals(Object) | Determines whether the specified ApplicationId object is equivalent to the current ApplicationId.(Overrides Object.Equals(Object).) |
![]() | GetHashCode() | Gets the hash code for the current application identity.(Overrides Object.GetHashCode().) |
![]() | GetType() | |
![]() | ToString() | Creates and returns a string representation of the application identity.(Overrides Object.ToString().) |
An application identity consists of the publisher's public key, the application name, the target processor architecture, the application culture, and the application version. The application identity properties values correspond to information contained in the application manifest. For more information about the application manifest, see ClickOnce Application Manifest.
ApplicationId is used by the ApplicationSecurityInfo class to identify a manifest-based application.
The following code example displays the ApplicationId properties by obtaining the ApplicationId from an ApplicationSecurityInfo instance created using the ActivationContext for the currently executing manifest-based application.
using System; using System.Collections; using System.Text; using System.Security.Policy; using System.Reflection; using System.Security; using System.Security.Permissions; namespace ActivationContextSample { public class Program : MarshalByRefObject { [SecurityPermission(SecurityAction.Demand, ControlDomainPolicy = true)] public static void Main(string[] args) { Console.WriteLine("Full name = " + AppDomain.CurrentDomain.ActivationContext.Identity.FullName); Console.WriteLine("Code base = " + AppDomain.CurrentDomain.ActivationContext.Identity.CodeBase); ApplicationSecurityInfo asi = new ApplicationSecurityInfo(AppDomain.CurrentDomain.ActivationContext); Console.WriteLine("ApplicationId.Name property = " + asi.ApplicationId.Name); if (asi.ApplicationId.Culture != null) Console.WriteLine("ApplicationId.Culture property = " + asi.ApplicationId.Culture.ToString()); Console.WriteLine("ApplicationId.ProcessorArchitecture property = " + asi.ApplicationId.ProcessorArchitecture); Console.WriteLine("ApplicationId.Version property = " + asi.ApplicationId.Version); // To display the value of the public key, enumerate the Byte array for the property. Console.Write("ApplicationId.PublicKeyToken property = "); byte[] pk = asi.ApplicationId.PublicKeyToken; for (int i = 0; i < pk.GetLength(0); i++) Console.Write("{0:x}", pk[i]); Console.Read(); } public void Run() { Main(new string[] { }); Console.ReadLine(); } } }
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

