Changed the application in app.manifest this line

<requestedExecutionLevel level="asInvoker" uiAccess="false" /> 

on this

 <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> 

The program is trying to write a new file to the directory in Program Files, but an error is displayed: "Access is denied on the path \" c: \ Program Files (x86) \ aaa \ aaa.exe \ ".".

If I change the rights to the folder of the group "Users (pc / Users)", it turns out, but initially there were no rights (to write and change), it turns out my changes to app.manifest have no effect, the launch comes from users and not from administrator, but why? UAC is disabled for me, so when launching a launch message on behalf of the administrator, it is not displayed, and if enabled, it is still not displayed when launching the application, such a feeling that changes in app.manifest are ignored. What could be the problem?

  • run from the studio or separately? - rdorn
  • By the way, if you run not from the studio, but the already compiled exe error is not issued, but copying does not happen - Ivan
  • rdorn - from the studio, here is the one that I described the situation, but without the studio itself exe, as written above, there is no error, but there is no copying either. - Ivan
  • one
    Well, the experiment confirmed, when implementing the manifest with the requirement of elevation of rights and autonomous launch of the release assembly, everything worked as expected, Casper also issued all its warnings, the file was recorded. - rdorn
  • 2
    actually it should be, because when launched from the studio, your program is not launched independently, but in the context of a debugger. - rdorn

1 answer 1

@rdorn : it should be so, because when launched from the studio, your program does not run independently, but in the context of the debugger

Run the compiled exe , not from the studio.