Checking my vs2010 WPF project.....
Under project properties edit app.manifest
Read the commented out part.
Change requestedExecutionLevel
But read up on it first. and think twice.
eg what happens if the user doesn't have admin privileges?
Or
Right click the shortcut.
Select run as administrator.
If they aren't admin and don't know the admin user and password then you
have a problem.
It appears that this is also supported in VS2008 and in a standard
Windows Forms app as well as a WPF app in VS2010.
But I noticed that the app.manifest file didn't exist until I opened
the project Properties Security tab and clicked "Enable ClickOnce
security settings" and saved the project. There may be other actions
that create the app.manifest for the first time, but this did it for
me.
I am only asking this because I would like to include a special XML
file in the application's startup path that the app looks at on
startup and if necessary performs the app's database upgrades that are
defined in the XML file. This works fine on XP but Vista and Win7
impose stronger restrictions on the Program Files folder than XP did,
and the app does not have access to the file when located there.
Is there a simple, SAFE way to accomplish this goal?