Take the 2-minute tour ×

I am trying to build an automation application in C# 2005 express edition under windows vista. Problem is, Whenever I try to run this application, either from IDE or directly compiled executable under vista, it asks for elevated admin privileges, same executable runs under XP normally though!

I'm unable to understand if this problem due to manifest or something else...


share|improve this question
Just a sidenote to the answers given by everyone else. Windows XP does not have UAC so users usually have Administrator priviledges so there would be no problem. This is the biggest problem people have with UAC in Vista is simply poorly designed software (software which pops up UAC when its not/shouldn't be neceessary) which worked fine under XP because of this. –  Daniel Brotherston Nov 25 '09 at 6:43
add comment

3 Answers

Firstly, I would update to 2008 Express; 2005 Express is no longer available for download, but 2008 Express can still target .NET 2.0, in addition to giving you 3.0/3.5 goodness. And it is still free. Actually, 2010 Express is just around the corner! In particular, you'll find it increasingly hard to find people who can answer 2005 Express IDE-specific issues, simply because few people have 2005 Express still installed.

Add an application manifest file (via the IDE) - it will appear as app.manifest; it should add (by default):


Which should (IIRC) help - but a: where is the app running from, and b: what does it do? (does it try to edit the registry, etc).

share|improve this answer
Thanks Marc for reply but I tried this solution before posting this here but it didn't solved my problem. :( –  DexTer Nov 25 '09 at 7:48
add comment

Additionally to Marc's answer: If the executable has i.e. 'setup' or 'install' as part of it's name, the UAC asks for admin privileges regardless of a manifest. The only work around that is to rename the .exe to something that does not contain these keywords.

Edit: 'Update' is such a keyword too. Please see also this Technet article about UAC.

share|improve this answer
Interesting, didn't know that. Out of curiosity though, have you a source for that info? –  RCIX Nov 25 '09 at 6:39
Is described in the technet: technet.microsoft.com/en-us/library/cc709628(WS.10).aspx Also 'update' is such a keyword. –  Sebastian P.R. Gingter Nov 25 '09 at 6:43
add comment

If your application attempts to do things that require elevated privileges (e.g. write to the Program Files folder or some areas of the registry), it will need to ask for elevation or it'll fail. Under XP it won't ask for elevation at all; it'll just fail if it doesn't have the permissions it needs to run (but usually people run with administrative privileges under XP, so this isn't often a problem)

To add one "gotcha" to the existing answers: If you use the file properties (Compatibility tab) on your .exe to force it to "run as administrator", it will always ask for elevation when it is run. Unintuitively, this is applied permanently to the pathname, so even if you delete the .exe and install a new one, the "as admin" setting will still apply! You have to specifically open the properties and disable that property to remove it again.

share|improve this answer
add comment

Your Answer


