Windows 7 和 Windows Server 2008 R2 中的不同 WinSxS 行为

发布于 2024-11-09 06:32:09 字数 1247 浏览 0 评论 0原文

我有一个可执行文件,其清单显示它依赖于

Microsoft.VC90.CRT 9.0.21022.8
Microsoft.VC90.CRT 9.0.30729.1

Windows 7,该可执行文件运行没有问题。 在 Windows Server 2008 R2 上,此可执行文件无法运行,并显示消息:

应用程序无法启动,因为其并行配置不正确。请参阅应用程序事件日志或使用命令行 sxstrace.exe 工具了解更多详细信息。

这是出乎意料的 - 我认为 Windows 7 和 Windows Server 2008 R2 在运行时可用性方面应该非常相似。两台机器都非常干净。 Windows 7 机器是全新安装的,上面没有任何东西。 Windows Server 2008 R2 计算机仅具有 Windows Update 的一些更新。

我检查了 Windows 7 计算机的 WinSxS 目录,发现

Microsoft VC90.CRT 9.0.30729.4926

我检查了 Windows Server 2008 R2 计算机的 WinSxS 目录,发现

Microsoft VC90.CRT 9.0.30729.4926

存在的运行时比清单中指定的更新,但 Windows Server 2008 R2 系统无法重定向到较新的版本运行时。在 Windows Server 2008 R2 上运行 sxstrace 显示:

INFO: Applying Binding Policy
    INFO: No publisher policy found.
    INFO: No binding policy redirect found.

在 Windows 7 上运行 sxstrace 给出:

INFO: Applying Binding Policy
    INFO: Find publisher policy at C:\Windows\WinSxS\manifest\amd64...
    INFO: Publisher Policy redirected assembly version.
    INFO: Post policy assembly identity is...

除了安装 VS 2008 运行时和 VS 2008 SP1 运行时之外,还有如何解决此问题的任何想法吗?我认为程序集的整体思想是它允许系统覆盖旧的运行时并替换新的运行时。

I've got an executable who's manifest says it depends on

Microsoft.VC90.CRT 9.0.21022.8
Microsoft.VC90.CRT 9.0.30729.1

On Windows 7, this executable runs with no problem.
On Windows Server 2008 R2, this executable fails to run with the message:

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

This was unexpected - I thought Windows 7 and Windows Server 2008 R2 should be very similar regarding runtime availability. Both machines are pretty clean. The Windows 7 machine is a fresh installation with nothing on it. The Windows Server 2008 R2 machine only has some updates from Windows Update.

I checked the Windows 7 machine's WinSxS directory and found

Microsoft VC90.CRT 9.0.30729.4926

I checked the Windows Server 2008 R2 machine's WinSxS directory and found

Microsoft VC90.CRT 9.0.30729.4926

The runtime that is present is newer than what is specified in the manifest and yet the Windows Server 2008 R2 system fails to redirect to the newer runtime. Running sxstrace on Windows Server 2008 R2 shows:

INFO: Applying Binding Policy
    INFO: No publisher policy found.
    INFO: No binding policy redirect found.

Running sxstrace on Windows 7 gives:

INFO: Applying Binding Policy
    INFO: Find publisher policy at C:\Windows\WinSxS\manifest\amd64...
    INFO: Publisher Policy redirected assembly version.
    INFO: Post policy assembly identity is...

Any ideas how this could be resolved besides installing the VS 2008 runtime and the VS 2008 SP1 runtime? I thought the whole idea of the assemblies was that it allowed the system to override the older runtimes and substitute the newer ones.

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

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

发布评论

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

评论(2

舞袖。长 2024-11-16 06:32:09

虽然原则上 WinSxS 允许兼容的较新版本的程序集替换旧版本,但 VS 运行时不使用此功能,并且仅绑定到它们编译时所针对的相同版本。要么针对同一版本的库重新编译应用程序的所有组件(可能是最好的,以避免多个 malloc 堆出现问题),要么安装两个运行时。

Although in principle WinSxS allows compatible newer versions of assemblies to replace older versions, the VS runtimes do not make use of this functionality, and bind only to the same version they were compiled against. Either recompile all components of your application against the same version of the library (probably best, to avoid problems with multiple malloc heaps) or install both runtimes.

流殇 2024-11-16 06:32:09

您可以将 VC++ 运行时 dll 放入应用程序的可执行目录中,它应该可以工作。
您还需要 2 个 dll(MSVCR 和 MSVCP)和清单。我突然想到,只需将所有 3 个文件放入应用程序的可执行目录中就可以了

You can put the VC++ runtime dlls in your application's executable directory and it should work.
You'll need the 2 dll's (MSVCR and MSVCP) and the manifest as well. Off the top of my head just putting all 3 of those files in the application's executable directory should do the trick

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