WPF 添加Adminstrator 权限

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

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

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

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

 

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

     为

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

 

3、去掉Enable ClickOnce security setting选项

好了。

posted @ 2014-09-04 11:44  zzhi.wang  阅读(3094)  评论(0编辑  收藏  举报