I am developing a portable application (no install) that needs administrator privileges to work properly, and I want it to run as administrator automatically so that the user doesn't have to. In the app.manifest file, I changed modified the requestedExecution level from asInvoker to highestAvailable:
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
(I also tried requireAdministrator)
And indeed, now my application always launches as administrator automatically. When I go to my debug folder ([application folder]/bin/debug), and run the .exe directly, it also launches as administrator by default. Even if I copy it to some other folder on my computer, all is good. The .exe even has that typical administrator sign on it's icon.
Unfortunately, when I sent my application to my friend, he reported that my application does not launch as administrator automatically, and there is no administrator sign on the application icon either. I have tried to find what the cause could be, to no avail. I am not even sure what information to provide with this question, as I have no idea what could be relevant in this case. As I understand it, the app.manifest is automatically included in the .exe file. There is an app.manifest file in the [application folder]/My Project folder, but even if I delete it from there, my application .exe still runs as administrator, so I guess manifest gets compiled into exe during build.
Can anyone please suggest what could be the cause here? If there's any more info needed that I didn't know to include, please do tell.