帮助!关于清单. [英] Help! About manifest.

查看:95
本文介绍了帮助!关于清单.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序需要部署在Vista中,并且需要管理员权限,否则无法正常运行.

众所周知,我需要在程序中添加一个清单,以告知Vista以管理员身份运行.所以我从网上复制了一个清单:

<?xml version ="1.0" encoding ="UTF-8" standalone =是"?
< assembly xmlns ="urn:schemas-microsoft-com:asm.v1"
manifestVersion ="1.0">
< assemblyIdentity
processorArchitecture ="x86"
版本="1.0.0.0"
type ="win32"
名称="test.exe"
/>
< description>测试</description>
< dependency>
< dependentAssembly>
< assemblyIdentity
类型="win32"
名称="Microsoft.Windows.Common-Controls"
版本="6.0.0.0"
publicKeyToken ="6595b64144ccf1df"
language ="*"
processorArchitecture ="x86"
/>
</dependentAssembly>
</dependency>

<!-确定应用程序安全性要求. ->
< trustInfo xmlns =< urn:schemas-microsoft-com:asm.v2">
< security>
< requestedPrivileges>
< requestedExecutionLevel
level ="requireAdministrator"
uiAccess =假"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

构建完成后,编译器将报告:清单创作警告 81010002:无法识别的元素"requestedPrivileges"在命名空间中 "urn:schemas-microsoft-com:asm.v2".

我使用VS 2005,有人知道出什么问题吗?
非常感谢.

解决方案

在新计算机上重新安装VS2005之后,我遇到了同样的问题.看来问题源于VS2005随附的旧版mt.exe.您需要使用Vista SDK附带的mt.exe.我的解决方案是确保将VS2005设置为使用Vista SDK中的新二进制路径.在VS2005中,安装SDK似乎并不会为您修改目录位置,因此请进入工具/选项.../项目和解决方案/VC ++目录".并从安装Vista SDK的位置添加新路径.这里重要的是可执行文件".应该具有以下内容:

C:\ Program Files \ Microsoft SDKs \ Windows \ v6.0 \ Bin

请确保在顶部添加Vista SDK,因为我相信那些首先使用.

Mark
Beiley软件


my program need to be deployed in vista, and need administrator's privileges, or it can't run well.

as known, i need to add a manifest to my program to tell Vista run as a administrator. so i copy a manifest from web:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="1.0.0.0"
type="win32"
name="test.exe"
/>
<description>test</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"
/>
</dependentAssembly>
</dependency>

<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

After building, the compiler reports: manifest authoring warning 81010002: Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-microsoft-com:asm.v2".

i use VS 2005 , can anybody know what's the problem?
Thanks a lot.

解决方案

I had this same problem after re-installing VS2005 on a new computer.  It seems the problem stems from an old mt.exe version that ships with VS2005.  You need to be using the mt.exe that ships with the Vista SDK.  My solution was to make sure VS2005 was set to use the new binary path from the Vista SDK.  Installing the SDK doesn't seem to modify the directory locations for you in VS2005, so go into"Tools / Options... / Projects and Solutions / VC++ Directories" and add the new paths from where you installed the Vista SDK.  The important one here is the "Executuable files" should have something like this:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin

Make sure to add the Vista SDK ones at the top, as I believe those are used first.

Mark
Beiley Software


这篇关于帮助!关于清单.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆