如何修复在 XP 上使用 vc2005 混合模式 DLL 导致 FileLoadException 的 CRT 依赖性?

发布于 2024-10-02 13:42:53 字数 1835 浏览 1 评论 0原文

我有一个在 Visual Studio 2005 中构建的混合模式 DLL。在依赖项遍历器中,我的 DLL 显示了以下 CRT Dll 的依赖项。请注意,这是在我的 Windows 7 开发计算机上。

c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5\MSVCP80.DLL

“\MSVCR80.DLL

”\MSVCM80.DLL

8.0.50727.4927

使用 Visual Studio 2005 的 Windows 7 开发计算机这编译并运行得很好。问题是它无法在我安装了最新 CRT 的 Windows XP 测试机上运行。

当我将 DLL 拖到 XP 计算机上的依赖步行器中时,它似乎正在 \System32... 中搜索 DLL...(我去显示完整路径,但没有它们的路径,只有一个黄色感叹号)

问题是WinSxS 中的此版本(内部版本 4927)的 crt 未安装在 XP 测试机上。它有 Visual Studio 2005,安装了最新的 CRT(sp1?)。

8.0.50727.4053 是我在 MSDN 上找到的最新版本。

我意识到这不是 SO 上发布的最令人兴奋的问题,但是有人知道这个 4927 运行时是怎么回事吗?

* 编辑 *

MT.exe 生成的清单:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.4053" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

因此,它针对的是 3 个不同的版本...

I have a mixed-mode DLL built in visual studio 2005. In dependency walker, my DLL is showing a dependency of the following CRT Dlls. Note this is on my Windows 7 developement machine.

c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5\MSVCP80.DLL

"\MSVCR80.DLL

"\MSVCM80.DLL

8.0.50727.4927

On my Windows 7 dev machine using Visual Studio 2005 this compiles and runs just fine. the problem is it wont run on my Windows XP test machine with the latest CRT installed.

When I drag the DLL into depenency walker on the XP machine it seems to be searching for the DLLs in \System32... (I went to show full path and there was no paths for them, just a yellow exclamation mark)

The problem is that this version (build 4927) of the crt in WinSxS is not installed on the XP test machine. it has Visual Studio 2005 with the latest CRT installed (sp1?).

8.0.50727.4053 is the latest version I could find on MSDN.

I realize this is not the most exciting question posted on SO, but does anyone know what is up with this 4927 runtime?

*
EDIT
*

The manifest generated by MT.exe:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.4053" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

So, there is 3 different versions it is targeting...

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

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

发布评论

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

评论(1

勿忘初心 2024-10-09 13:42:53

修订版 4927 是 Windows 7 特定版本,可能由 Microsoft 二进制文件使用。你的构建不应该创建对它的依赖,4053 是 VS2005 的最后一个。顺便说一句,不要使用depends.exe 来解决此问题,它不擅长跟踪winsxs 依赖项。

通过仔细检查您的构建生成的依赖关系来开始解决此问题。首先查看 vc\include\crtassem.h,_CRT_ASSEMBLY_VERSION 宏生成清单条目。接下来是检查嵌入在可执行文件中的清单。您的项目的 Release 目录包含嵌入的 .embed.manifest 文件。可执行文件上的“文件”+“打开”+“文件”可让您查看实际嵌入的 RT_MANIFEST 资源。

Revision 4927 is a Windows 7 specific version, probably used by Microsoft binaries. Your build should not create a dependency on it, 4053 is the last one for VS2005. Don't troubleshoot this with depends.exe btw, it isn't good at tracking winsxs dependencies.

Start troubleshooting this by double-checking what dependency your build generates. First look in vc\include\crtassem.h, the _CRT_ASSEMBLY_VERSION macro generates the manifest entry. Next is to check the manifest that's embedded in your executable. Your project's Release directory contains the .embed.manifest file that was embedded. And File + Open + File on your executable lets you peek at the actual embedded RT_MANIFEST resource.

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