How can I embed an application manifest into an application using VS2008?

Dacto picture Dacto · Dec 8, 2010 · Viewed 45.8k times · Source

I've read here and here for ways to embed my application's manifest files inside the PE but these steps do not seem to work for VC#:VS2008 - VS2008 doesn't even come with mt.exe (as far as i know)

How might I go about doing this?

Answer

Cody Gray picture Cody Gray · Dec 8, 2010

You can add a manifest to your C# application by following these steps:

  1. Right-click on your project in the Solution Explorer
  2. Select "Add New Item" from the context menu.
  3. Choose "Application Manifest File" from the list of options in the dialog box that appears.

However, note that Visual Studio already adds a manifest to your project by default in order to ensure compliance with UAC found in Windows Vista and 7. If you want to specify that a custom manifest file should be used by your project instead, follow these additional steps:

  1. Once you've added your custom manifest file to your project, right-click on your project in the Solution Explorer and click "Properties" (or double-click on the "Properties" item under your project).
  2. Under the first tab ("Application"), you should see a group of options specifying how your application manages resources. You can leave the default "Icon and manifest" option selected, but you need to select your custom manifest file from the drop-down box labeled "Manifest".

Finally, for the sake of completeness or if the above steps don't work for you, you can still use mt.exe to embed your manifest file into your application's EXE after you've built it. If it wasn't included with your installation of Visual Studio, you'll need to download and install the Windows SDK. Get the latest version for Windows 7 and the .NET Framework 4.0 here.