How to force a service's bitness

江枫思渺然 提交于 2019-12-13 02:16:51

问题


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

This wouldn't be a problem except that I migrated all shared configuration, to C:\Windows\Microsoft.NET\Framework\v4.0.30319\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)

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


回答1:


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.



来源:https://stackoverflow.com/questions/6420841/how-to-force-a-services-bitness

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!