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

发布于 2024-11-10 04:12:21 字数 2456 浏览 0 评论 0原文

我正在使用 VS2010 开发一个使用 Havok 的项目,而最新版本仅包含 VS2008 和更早版本的二进制文件。 VS 生成的嵌入式清单包含以下内容

<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

因为显然 VS 不再使用并排程序集 (source)从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.

应用程序在我同事的一台机器上运行,因为(大概)他在上面安装了 VS2008,但在另一位同事或我的机器上则不行,因为我们只安装了 VS2010。工作机在winsxs目录中唯一的debugcrt文件是

x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb

一个包含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.

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

唯一有效的是禁用嵌入式清单生成。还有其他方法可以解决这个问题吗?

I'm working with VS2010 on a project that uses Havok, and the latest release only has VS2008 and earlier binaries. The embedded manifest generated by VS contains the following

<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

Since apparently VS no longer uses side-by-side assemblies (source) starting with 2010, my winsxs directory doesn't have the debug crt assemblies installed, and the vs redistributable package doesn't install the debug versions. If we compile the dlls that use Havok with an embedded manifest, applications loading the dlls fail to start.

I ran sxstrace and got the following:

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.

The applications work on one of my coworker's machines, since (presumably) he had VS2008 installed on it, but not on another coworker's or mine, since we have only had VS2010 installed. The only debugcrt files the working machine has in the winsxs directory are

x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb

as a folder with the dlls, a .manifest file, and a .cat file (same publicKeyToken but different version)

I've tried copying the files over to my winsxs directory, which didn't fix the problem. Placing the dlls directly into the directory with the binaries also did nothing. Placing the files into bin\Microsoft.VC90.DebugCRT.DLL (since that was one of the directories searched according to sxstrace) also failed to help, but the output from sxstrace changed to

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.

(it stops searching, and is able to resolve the reference but context generation still fails)

The only thing that works is disabling embedded manifest generation. Is there another way of resolving this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕嗳→ 2024-11-17 04:12:21

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

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

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

On the working computer, look in the folder:

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

This is where the runtime dlls of the version needed to run are located. There is also a manifest file there. You can look in the event viewer (eventvwr.exe) to see which version of the DLLs the exe is looking for, and then you can modify the manifest file (rather, modify a copy that you place in the executable directory with the dlls) so it will identify the included files as being that version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文