在WPF应用开发中,需要WPF操作后台注册的Windows Service,可是WIX打包的安装程序不具备赋予WPF App默认管理员权限。

因此,需要我们手工在WPF项目中添加管理员权限:

1、右击项目->Properpies->Security->Enable ClickOnce security setting,

     你将看到项目属性目录下出现app.manifest文件

WPF 添加Adminstrator 权限

 

2、修改修改节点<requestedExecutionLevel  level="asInvoker" uiAccess="false" />

     为

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

WPF 添加Adminstrator 权限

 

3、去掉Enable ClickOnce security setting选项

好了。

相关文章:

  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-01-18
猜你喜欢
  • 2021-10-02
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-12-16
  • 2021-08-02
相关资源
相似解决方案