Eliminating Manifest Files

Friday, September 24, 2004

If you have done anything with .Net and Windows XP you know the burden of the .Manifest file. Visual Styles support is essential for a professional looking application. But a manifest is nothing more than a text file filled with XML. An application's dependence on a manifest file creates a weak point in your application. Loss of this file will change how the program looks and reacts to the user. But, ninety-nine percent of the time I'm just irked because it's there when it shouldn't have to be. Why have two files to do the job of one?

Thankfully Visual Studio .Net 2003 gave developers a shortcut, allowing for the enabling of Visual Styles through the Application object. (C# example: Application.EnableVisualStyles();) This covers all the controls you use, but leaves out a few things. For starters, XP icons in listviews. The only way to get an icon to showup, in a listview, is to use a manifest file. There is absolutely no way around it. (I'm still not sure why MS decided not to support embedding of manifests in the VS IDE. It seems so logical.)

But there is a solution. You can inject a manifest file into an existing .Net executable. Now the world can be free of married manifest files. Long live the single EXE files with visual styles support. Thank you Acoustic, whoever you are.