代码之家  ›  专栏  ›  技术社区  ›  Steve Cooper

强制.Net Windows服务在64位计算机上以32位运行

  •  39
  • Steve Cooper  · 技术社区  · 15 年前

    我得到了一个windows服务,它引用了一个只在32位上运行的COM组件。 我的机器是x64,因此服务尝试启动,无法创建COM组件,然后停止。

    2 回复  |  直到 15 年前
        1
  •  71
  •   Thomas Freudenberg    15 年前

    也许是.NET工具 corflags

    corflags /32bit+ myservice.exe

        2
  •  2
  •   David B    6 年前

    corflags.exe随Windows SDK而不是.NET提供。

    corflags.exe只需针对目标服务exe运行一次。然后,服务将在32位模式下运行。

    注意所需的参数是/32bitreq+或/32bitref+。

    corflags.exe/32bitreq+myservice.exe