我创建了一个简单的 Windows 服务,该项目的平台是 Any CPU 并且我使用 installutil.exe 命令安装了我的服务。然后我卸载了该服务并将平台设置为X64。但在此之后,我无法安装该服务。我收到以下错误
Exception occured while initializing the installation: System.BadImageFormatException:Could not load file or assembly -- or one of its dependencies. An attempt was made to load a program with an incorrect format.
我想将平台更改为 X64 以使用一些 dll。请帮助我。
最佳答案
您必须选择 x86 平台,dll 以混合模式运行并将与您的服务一起工作
关于c# - Windows 服务无法在其他平台上安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23926750/