问题
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