如何强制服务的位数 [英] How to force a service's bitness

查看:21
本文介绍了如何强制服务的位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个 C# Windows 服务.一个人坚持以 64 位进程运行.

I have several C# Windows service. One insists on running as a 64 bit process.

这不是问题,只是我将所有共享配置迁移到 C:WindowsMicrosoft.NETFrameworkv4.0.30319Config

This wouldn't be a problem except that I migrated all shared configuration, to C:WindowsMicrosoft.NETFrameworkv4.0.30319Config

因此该服务无法读取配置,目前我不得不复制共享配置(这使将其移动到 machine.config 的意义不大)

As a result the service fails to read the config, and for the moment I am having to duplicate the shared configuration (which defeats the point of moving it to machine.config)

我已将构建配置从 x64 更改为 x86,并重新安装,但该服务仍以 64 位模式运行.

I have changed the build configuration from x64 to x86, and re-installed but the service still runs in 64 bit mode.

推荐答案

Execute Corflags/+32Bit [Service.Exe](.Net SDK 的一部分),它将通知操作系统该程序集必须以 32 位模式加载.

Execute Corflags /+32Bit [Service.Exe] (part of the .Net SDK) which will notify the OS that this assembly must be loaded in 32 bit mode.

这篇关于如何强制服务的位数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆