如何强迫服务的咬人 [英] How to force a service's bitness

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

问题描述

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

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

这不是问题,只不过我将所有共享配置都迁移到了C:\Windows\Microsoft。 NET\Framework\v4.0.30319\Config

This wouldn't be a problem except that I migrated all shared configuration, to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config

结果是该服务无法读取配置,目前我必须复制共享配置(这克服了将其移动到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.

推荐答案

执行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天全站免登陆