What should you do?

You are currently creating a manifest-activated application on the Domain.com’s intranet using ClickOnce deployment.
The network administrator informs you that each application has to identify its name, version, culture, and requested permissions.
You need to ensure that the application you are creating uses the command line to display the required information.
What should you do?

You are currently creating a manifest-activated application on the Domain.com’s intranet using ClickOnce deployment.
The network administrator informs you that each application has to identify its name, version, culture, and requested permissions.
You need to ensure that the application you are creating uses the command line to display the required information.
What should you do?

A.
Use the following code:
ApplicationSecurityInfo appInfo = new
ApplicationSecurityInfo(appDomain.CurrentDomain);
Console.Writeline (appInfo.ApplicationID.Name);
Console.Writeline (appInfo.ApplicationID.Version);
Console.Writeline (appInfo.ApplicationID.Culture);
Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

B.
Use the following code:
ApplicationSecurityInfo appInfo = ActivationContext.GetCurrentContext ();
Console.Writeline (appInfo.ApplicationID.Name);
Console.Writeline (appInfo.ApplicationID.Version);
Console.Writeline (appInfo.ApplicationID.Culture);
Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

C.
Use the following code:
ApplicationSecurityInfo appInfo = new
ApplicationSecurityInfo(appDomain.CurrentDomain.ActivationContext);
Console.Writeline (appInfo.ApplicationID.Name);
Console.Writeline (appInfo.ApplicationID.Version);
Console.Writeline (appInfo.ApplicationID.Culture);
Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

D.
Use the following code:
ApplicationSecurityInfo appInfo = ActivationID.GetCurrentApplication ();
Console.Writeline (appInfo.ApplicationID.Name);
Console.Writeline (appInfo.ApplicationID.Version);
Console.Writeline (appInfo.ApplicationID.Culture);
Console.Writeline (appInfo.DefaultRequestSet.ToXml ());

Explanation:
Answer C
The ApplicationSecurityInfo class represents the security evidence for a manifest-activated application.
The constructor requires an ActivationContext object that represents the manifest activation context of the application.
The AppDomain.CurrentDomain.ActivationContext property retrieves the activation context of the current manifest-activated application.
The DefaultRequestSet property represents the permission set the application is requesting of the local system.
Incorrect Answers:
A, B, D: You should not use the code fragments because they attempt the retrieve the ApplicationSecurityInfo object through non-existent methods.



Leave a Reply 0

Your email address will not be published. Required fields are marked *