关于清单文件 [英] About Manifest file
问题描述
最近,我遇到了一个非常奇怪的问题,该问题仅在Windows XP SP3和Vista中发生.这是我的步骤:
Recently, I encountered a very strange issue, this issue only happens in Windows XP SP3 and Vista. Here are my steps:
- 在桌面上创建两个新文件夹(假设文件夹名称为A和B)
- 将Microsoft GraphEdit(
graphedt.exe
)应用程序复制到A文件夹,然后也创建一个空的graphedt.exe.manifest
文件.运行graphedt.exe
,您会看到一条错误消息,由于清单错误,graphedt.exe
无法运行. - 将Microsoft GraphEdit(
graphedt.exe
)应用程序复制到B文件夹,运行graphedt.exe
并关闭它,然后创建一个空的graphedt.exe.manifest
文件,再次运行graphedt.exe
,您将看到清单文件不适用于graphedt.exe
.但是,如果您更改graphed.exe
的最后修改时间,则清单将再次起作用.
- Create two new folders in desktop (assume folder names are A and B)
- Copy Microsoft GraphEdit (
graphedt.exe
) application to A folder, then create a emptygraphedt.exe.manifest
file as well. Rungraphedt.exe
, you will see a error message, thegraphedt.exe
can’t run due to the wrong manifest. - Copy Microsoft GraphEdit (
graphedt.exe
) application to B folder, rungraphedt.exe
and close it, then create a emptygraphedt.exe.manifest
file, rungraphedt.exe
again, you will see the manifest file can’t apply tographedt.exe
. But if you change the last modified time ofgraphed.exe
, the manifest will work again.
Windows似乎在EXE第一次使用清单文件时会记住该状态,但是如果您更改EXE大小或上次修改日期,Windows也会重置以前记住的状态.
It seems Windows will remember the status the first time the EXE uses a manifest file, but also Windows will reset the old remembered status if you change the EXE size or last modified date.
推荐答案
[我是Microsoft当前的SxS维护者]
[I'm the current SxS maintainer at Microsoft]
良好的调查仪岗.您是在Vista而不是XP SP3上描述这种行为.
Good investigation Yigang. You're describing the behavior on Vista, not on XP SP3.
每次运行应用程序时探查清单是否存在将是性能问题,因为通常应用程序具有清单或没有清单,并且该状态不会有太大变化.因此,在Vista上,第一次运行应用程序时,我们缓存了一段描述此应用程序具有关联的清单"或此应用程序没有清单"的信息.第一次运行graphedtt.exe时,Windows缓存了缺少清单的文件,随后将不再查找清单.要重置缓存,请更新可执行文件的上次修改时间.
Probing for the existence of a manifest every time an app is run would be a performance issue, since usually apps either have a manifest or don't, and that state doesn't change much. For this reason, on Vista, the first time an application is run, we cache a bit describing "this application has an associated manifest" or "this application does not have a manifest". When you ran graphedt.exe the first time, Windows cached the absence of a manifest, and will subsequently not look for one. To reset the cache, update the last modified time on the executable.
这篇关于关于清单文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!