I have two projects that were written by others, one is a WPF application and the other a Console application. The WPF application is generating a .exe.manifest file alongside the executable, somehow automatically generated using the project settings (it is not explicitly declared as app.manifest). But the Console application is not generating one. How would I set it up to generate one?
For C/C++ in Visual Studio 2013 I've found 2 ways:
The modern way: Merge in additional XML
Go to (properties) > Linker > Manifest and change Generate Manifest to YES. You can also set UAC / admin rights here without needing to create your own manifest XML.
Add a new XML file to the project, and include other manifest entries that you need inside of an assembly wrapper tag, for example:
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- 10.0 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
Go to (properties) > Manifest Tool > Input and Output and add the XML file from step 2 using the Additional Manifest Files setting
The Manual way: Use a custom RC file
If you add a second RC file that is manually edited to your project you can include a manifest XML file.
In the RC file, add these lines
#define MANIFEST_RESOURCE_ID 1
MANIFEST_RESOURCE_ID RT_MANIFEST "res\\my-manifest-xml.manifest"
For this you need to make sure your XML file includes all tags needed for the manifest.
Testing the results
SigCheck from Systenternals has an -m option that will show you the manifest.
SigCheck - SysInternals - TechNet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With