解决 side-by-side 问题的一种方法

来源:互联网 发布:手机百度云网络异常 编辑:程序博客网 时间:2024/05/17 03:11

解决 side-by-side 问题的一种方法

VS7.0开始引入了manifest的机制,程序必须经过部署才能运行。Release版本的程序可以通过安装VC++的Redistributable包完成部署。Debug版本的程序微软没有提供对应的Redistributable包。如果在没有安装VS的机器上运行就会遇到side-by-side错误。

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 for more detail。

对此MSDN网站提供了一种解决方案。但是需要有已经安装好的VS,对于我这样只使用命令行做编译没有完整IDE的并不适用。下面用一种workaround方法也能快速的完成Debug环境的部署。

以下以VS2005为例,首先安装需要的merge module(.msm文件)。msm不支持直接安装,可以通过msm2msi工具把它转换成msi来安装。msm2msi下载地址。

因为我只用到了CRT库,只需要转换并安装两个msm,

  • Microsoft_VC80_DebugCRT_x86.msm
  • policy_8_0_Microsoft_VC80_DebugCRT_x86.msm

注意其中的policy也需要安装。安装完毕后可以在winsxs目录下找到如下manifest文件

  • x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.42_none_ef74ff32550b5bf0.manifest
  • x86_policy.8.0.microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.42_none_3825408a574a21cb.manifest

然后需要把相关的dll复制到winsxs的对应目录下,目录名称和manifest名称相同,如本例中应为

x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.42_none_ef74ff32550b5bf0

附上用到的工具
msm转msi工具msm2msi
http://download.csdn.net/detail/shermanwan/9648703
vs2005 debugcrt 发布包
http://download.csdn.net/detail/shermanwan/9648716

0 0
原创粉丝点击