获得“程序兼容性助手”对话框的原因? [英] Reasons for getting the Program Compatibility Assistant dialog?
问题描述
在我的应用程序关闭后出现程序兼容性助手对话框的可能原因是什么?
(来源: microsoft.com )
Program Compatibility Assistant: frequently asked questions
我意识到这个问题已经在SO上提出了
I realize this question has already been asked on S.O.
- Program Compatibility Assistant thinks my app is an installer
- Windows 7 Program Compatibility Assistant appeared for my app. Why?
- Why I receive a message from the Program Compatibility Assistant?
- How do I prevent programmatically the "Program Compatibility Assistant" in Vista (and Windows 7) from appearing?
但是,我的应用程序:
- 仅得到 PCA 关闭后
- 不要尝试执行任何需要提升权限的事情(我不认为)
- 不要从IDE运行时获得 PCA
- 不是安装程序/安装程序
- 没有安装程序或程序名称中的设置
- 关闭时不会抛出异常,也不会使用0以外的代码退出(我不认为)
- 没有得到 PCA ,如果我在应用清单中添加
< compatibility>
节点
- Only gets PCA after it closes
- Does not attempt to do anything that requires elevated privileges (I don't think)
- Does not get PCA when run from IDE
- Is not an installer/setup program
- Does not have "installer" or "setup" in the program name
- Does not throw an exception when it closes, or exit with a code other than 0 (I don't think)
- Does not get PCA if I add
<compatibility>
node to application manifest
注释#6,使用以下app.manifest,我不再获得PCA:
Note #6, with the following app.manifest, I no longer get the PCA:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
</asmv1:assembly>
所以第二部分似乎已解决,但我担心我的应用程序仍在执行某些操作我不知道。
So that second part seems to fix it, but I am worried that my application is still doing something that I am unaware of.
要明确,我要问一个两部分的问题:
- 哪些问题会导致PCA对话框出现?
-
< compatibility>
节点是绝对必要的,以避免PCA对话框?还是我可能还是做错了什么?
- What issues can cause the PCA dialog to appear?
- Is the
<compatibility>
node absolutely necessary in order to avoid the PCA dialog? Or might I still be doing something wrong?
推荐答案
此MSDN文章描述了可能导致程序兼容性助手启动的许多条件。将查看它所描述的场景,并查看其中是否适用于您的程序。我确实看到了超出您排除的条件的PCA对话框的原因(例如,尝试在%ProgramFiles%
下创建新文件夹)。
This MSDN article describes the many conditions that can cause the Program Compatibility Assistant to kick in. I would review the set of scenarios that it describes and see whether any of them apply to your program. I do see causes for PCA dialogs outside of the conditions you ruled out (e.g., attempting to create a new folder under %ProgramFiles%
).
这篇关于获得“程序兼容性助手”对话框的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!