The #develop teamblog
#  Friday, 28 September 2007

From .NET 1.x times, you might remember .manifest files as the way to enable XP visual styles support in your application.

Application manifests are important in Vista. If your application does not have a manifest, Vista will treat it as legacy application and enable file and registry virtualization. This allows the program to write to its own application directory even if it does not have write access to it - the writes are stored in some hidden folder in the user profile. This redirection can cause a lot of confusions when users try to save files using your program where they don't have write access, and instead of getting an error message the files get saved somewhere else!

Vista also has to determine if programs need administrative rights and should cause a UAC prompt. To do that, it uses a heuristic that looks at the file name and string resources to guess if it should elevate. Using a manifest, you can tell Vista if your program needs elevation and avoid the risk of Vista guessing incorrectly.

Previously, you had to distribute the .manifest file along with the .exe; or you had to embed it in the .exe using a post-build action calling mt.exe.

The C# 3.0 compiler has built-in support for embedding manifests, and actually creates a default manifest that turns virtualization off and tells Vista not to elevate if you don't explicitly tell the compiler not to embed a manifest.

Support for embedding manifests is now available in the SharpDevelop project options:

You can choose to embed the default manifest, not embed any manifest, or to embed a custom manifest.
If you select <Create...>, SharpDevelop will automatically create a file called "app.manifest" in your project. The app.manifest created by SharpDevelop is similar to the default manifest the C# compiler uses; it just adds some comments so you don't have to look up how to control Vista's UAC.

Categories: Daniel
Friday, 28 September 2007 23:08:15 (GMT Daylight Time, UTC+01:00)  #    Comments [1]


Saturday, 29 September 2007 02:52:43 (GMT Daylight Time, UTC+01:00)
Well done. Finally I can give up Visual C# 2008 Beta 2 and move to SharpDevelop 3.0. Thanks very much.
Comments are closed.

© Copyright 2016 SharpDevelop Core Team

Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)


Copyright ©2000-2009 IC#Code. All rights reserved. Projects sponsored by AlphaSierraPapa.