我有一个可执行文件,其清单表明它依赖于
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运行时,还有什么其他方法可以解决这个问题吗?我以为程序集的整个理念就是允许系统覆盖旧的运行时并替换成新的运行时。