如何在头文件中为并行程序集指定清单? 我用VisualC++ 2008开发了MSMQ。在Windows Vista中,应用程序找不到位于C:\Windows\winsxs>cd x86\u microsoft-Windows-msmq-runtime-core\u 31bf3856ad364e35\u 6的mqrt.dll。 0.6002.18005_none_574cf1cdb624ee17\mqrt.dll

如何在头文件中为并行程序集指定清单? 我用VisualC++ 2008开发了MSMQ。在Windows Vista中,应用程序找不到位于C:\Windows\winsxs>cd x86\u microsoft-Windows-msmq-runtime-core\u 31bf3856ad364e35\u 6的mqrt.dll。 0.6002.18005_none_574cf1cdb624ee17\mqrt.dll,c++,windows,visual-studio-2008,manifest,C++,Windows,Visual Studio 2008,Manifest,WinSxS中清单的说明如下: <assembly xmlns="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0" description="MSMQ core runtime component." displayName="MSMQ Core runtime component" company="Microsoft" copyright="Copyright (c) Microsoft Corporation. All R

WinSxS中清单的说明如下:

<assembly xmlns="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0" description="MSMQ core runtime component." displayName="MSMQ Core runtime component" company="Microsoft" copyright="Copyright (c) Microsoft Corporation. All Rights Reserved." creationTimeStamp="2005-03-11T01:47:18" lastUpdateTimeStamp="2005-03-11T01:48:59">
  <assemblyIdentity name="Microsoft-Windows-msmq-runtime-core" version="6.0.6002.18005" processorArchitecture="x86" language="neutral" buildType="release" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" />
使用mt.exe将清单嵌入到exe中。但它不起作用。sxstrace中的错误消息为:

INFO: Resolving reference Microsoft-Windows-msmq-runtime-core,processorArchitecture="x86",publicKeyToken="31bf3856ad364e35",version="6.0.6002.18005".
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft-Windows-msmq-runtime-core\6.0.6002.18005__31bf3856ad364e35\Microsoft-Windows-msmq-runtime-core.DLL.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core.DLL.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core.MANIFEST.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core\Microsoft-Windows-msmq-runtime-core.DLL.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core\Microsoft-Windows-msmq-runtime-core.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft-Windows-msmq-runtime-core,processorArchitecture="x86",publicKeyToken="31bf3856ad364e35",version="6.0.6002.18005".
ERROR: Activation Context generation failed.
我尝试了以下pragma,但WinSxS甚至没有尝试解析msmq(可能是因为versionScope属性):


什么是正确的pragma?

我真的不知道它为什么找不到程序集。当我遇到这样的问题时,我从SysInternals(现在托管在microsoft.com上)那里去查看所有进入WinSxS存储的文件

iirc,清单探测是/是由与应用程序进程不同的进程完成的,因此不要使用自己的EXE名称进行筛选

无论如何,它试图寻找的文件夹显然不同于我案件中存在的文件夹,它为我提供了一条可靠的调查途径

INFO: Resolving reference Microsoft-Windows-msmq-runtime-core,processorArchitecture="x86",publicKeyToken="31bf3856ad364e35",version="6.0.6002.18005".
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft-Windows-msmq-runtime-core\6.0.6002.18005__31bf3856ad364e35\Microsoft-Windows-msmq-runtime-core.DLL.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core.DLL.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core.MANIFEST.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core\Microsoft-Windows-msmq-runtime-core.DLL.
                INFO: Attempt to probe manifest at c:\qt\datamon\bin\Microsoft-Windows-msmq-runtime-core\Microsoft-Windows-msmq-runtime-core.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft-Windows-msmq-runtime-core,processorArchitecture="x86",publicKeyToken="31bf3856ad364e35",version="6.0.6002.18005".
ERROR: Activation Context generation failed.
#pragma comment(linker, "\"/manifestdependency:name='Microsoft-Windows-msmq-runtime-core' version='6.0.6002.18005' processorArchitecture='x86' publicKeyToken='31bf3856ad364e35' language='neutral' buildType='release' versionScope='nonSxS'\"")