I have seen how add manifest to a application (Console app, or Windows Form app) using this reference How can I embed an application manifest into an application using VS2008?
here and here for ways to embed my application's manifest files inside the PE
You can add a manifest to your C# application by following these steps:
- Right-click on your project in the Solution Explorer
- Select "Add New Item" from the context menu.
- Choose "Application Manifest File" from the list of options in the dialog box that appears.
Now,
I want get programmatically if an application has application manifest and for example get level and uiAccess values from requestedExecutionLevel node.
<security>
<applicationRequestMinimum>
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
And two alternatives for that solution,
1) Add the code in source code of application.
2) Add the code in a common library that use some applications.
Any final solution with full source code sample application ?
IMHO, better samples for minimize learning curve are real applications with full source code and good patterns.