为VS2008编译的二进制文件需要DebugCRT并行组装,在VS2010中不起作用

ata*_*rck 10 manifest side-by-side visual-c++

我正在使用VS2010处理使用Havok的项目,而最新版本只有VS2008和更早版本的二进制文件.VS生成的嵌入式清单包含以下内容

<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
Run Code Online (Sandbox Code Playgroud)

由于VS显然不再使用从2010开始的并排程序集(源代码),因此我的winsxs目录没有安装调试crt程序集,并且vs可再发行程序包不会安装调试版本.如果我们使用嵌入式清单编译使用Havok的dll,则加载dll的应用程序无法启动.

我运行sxstrace并得到以下内容:

INFO: Begin assembly probing.
INFO: Did not find the assembly in WinSxS.
INFO: Attempt to probe manifest at G:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at D:\Projects\GTS new\bld\Debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at D:\Projects\GTS new\bld\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at D:\Projects\GTS new\bld\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at D:\Projects\GTS new\bld\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Did not find manifest for culture Neutral.
INFO: End assembly probing.
ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
Run Code Online (Sandbox Code Playgroud)

应用程序在我的一个同事的机器上工作,因为(据推测)他安装了VS2008,但不是在另一个同事或我的机器上,因为我们只安装了VS2010.工作机器在winsxs目录中唯一的debugcrt文件是

x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb
Run Code Online (Sandbox Code Playgroud)

作为包含dll,.manifest文件和.cat文件的文件夹(相同的publicKeyToken但版本不同)

我已经尝试将文件复制到我的winsxs目录,这不能解决问题.将dll直接放入带有二进制文件的目录中也没有做任何事情.将文件放入bin\Microsoft.VC90.DebugCRT.DLL(因为这是根据sxstrace搜索的目录之一)也无法提供帮助,但sxstrace的输出更改为

INFO: Begin assembly probing.
INFO: Did not find the assembly in WinSxS.
INFO: Attempt to probe manifest at G:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at D:\Projects\GTS new\bld\Debug\Microsoft.VC90.DebugCRT.DLL.
INFO: End assembly probing.
ERROR: Activation Context generation failed.
Run Code Online (Sandbox Code Playgroud)

(它停止搜索,并能够解析引用,但上下文生成仍然失败)

唯一有效的是禁用嵌入式清单生成.还有另一种解决方法吗?

Moz*_*zis 1

在工作计算机上,查看文件夹:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC90.DebugCRT

这是需要运行的版本的运行时 dll 所在的位置。那里还有一个清单文件。您可以在事件查看器 (eventvwr.exe) 中查看该 exe 正在查找哪个版本的 DLL,然后可以修改清单文件(而不是修改与 DLL 一起放置在可执行目录中的副本)因此它会将包含的文件识别为该版本。