“ClickOnce does not support the request execution level 'requireAdministrator.'”

前端 未结 11 1637
暗喜
暗喜 2020-12-07 15:33

So I was writing an application that requires access to the registry. I had not touched any build settings, wanting to get the thing working before I added the other touches

11条回答
  •  再見小時候
    2020-12-07 16:05

    For anyone who's run into this, I thought I'd contribute what ended up working for me.

    Yep, the 'Enable ClickOnce security settings' option automatically gets re-checked, if you un-check it, when you do Build > Publish .

    For me, I don't need to 'Publish' -- it's a simple, portable .exe that creates Scheduled Tasks for my users and I needed to make sure it elevated, even when logged-in as an Administrator.

    So I just grabbed my latest .exe from \bin\Release and that's what gets deployed on my clients' systems.

    Worked just as expected -- i.e. when I put it on a system w/ UAC enabled/at its highest setting, the .exe has the 'shield' on it, and when I run it, even when logged-in as an Administrator, it elevates and I get the UAC prompt.

    My little task scheduler app is now able to create the task without getting an 'Access Denied' error (which previously, could only be worked-around by right-clicking the .exe and clicking Run as Administrator).

提交回复
热议问题