Embedding manifests to C# EXE files with mt.exe tool
Posted: (EET/GMT+2)
If you want to create proper Windows Vista compatible application (especially for visual studio and UAC), you will need to add a manifest into your EXE files. There are multiple ways to do this (with and without Visual Studio), but my recommendation is that you use the MT.EXE utility, which is part of the Windows SDK.
With this tool, you can first create your XML based manifest file, set the proper requestedExecutionLevel value for UAC, and then use the MT.EXE tool for instance like this:
mt.exe -manifest MyManifest.xml -outputresource:MyApp.exe
Of course, you might also compile a .RES file from your XML based manifest with RC.EXE (Resource Compiler), but when you link this file into your executable with Visual Studio 2005/C#, the problem is that your assembly/version information and copyrights will then get lost under Project properties/Application/Assembly Information. This is the reason I'm recommending you to use MT.EXE instead of embedding your manifests directly.
Note: there are newer and older version of MT.EXE available in different SDKs. Unfortunately, not all versions work correctly, and I recommended that you use at least version 5.2.3790.2075 (dated 19-Oct-2006). It comes at least with the Windows Vista SDK.