Tue, March 6, 2007, 04:45 AM under
Orcas |
VisualStudio |
UAC
The first thing you should do with your applications on Windows Vista (and indeed a logo certification requirement) is embed a manifest in your application that effectively tells Windows that your app is aware of
User Account Control. I have explained how to do this with VS2005
here. Also Catherine listed a few ways
here. Bottom line: create a manifest like
this, and embed it in your project with a post-build command:
"$(DevEnvDir)..\..\Common7\Tools\Bin\mt.exe" -manifest "$(ProjectDir)$(TargetName).exe.manifest" –outputresource:"$(TargetDir)$(TargetFileName)";#1
In VS Orcas C# projects, life becomes slightly easier. Effectively, there is a combobox under the
Application tab in the project properties that allows you to point to a manifest and then it will embed it in the application. I cannot find this option in VB projects yet.
![](http://www.danielmoth.com/Blog/PropertiesManifest.jpg)
To me, there isn't much difference between pasting the command line from further above in the post build box and instead choosing a combobox item. However the latter does have the advantage of being more discoverable :-)
UPDATE: FYI, I got the below from Saurabh Jain (a dev on the team responsible) with regards to the March CTP:
"There is more support for manifests then you might see.
Firstly, the compilers have new switches for manifest, so there is no post build event.
C:\>csc.exe /? | findstr -i man
/win32manifest:<file> Specify a Win32 manifest file (.xml)
/nowin32manifest Do not include the default Win32 manifest
Secondly, if you have a .manifest file in your project, that file will appear in the dropdown. You can then select the file, and it will be passed to compiler. This is how one can add a custom manifest file."