如何在32位计算机中创建的64位计算机中运行Windows服务? [英] how can i run the windows service in 64 bit machine which is created in 32 bit machine?

查看:87
本文介绍了如何在32位计算机中创建的64位计算机中运行Windows服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经在32位计算机上使用.net2.0创建了.msi文件.我在.msi安装程序文件中使用Windows服务.当我在32位计算机上运行此.msi文件时,它工作正常.当我在64位mahcine Windows服务中运行时,无法启动.

Hi All,

I have created an .msi file using the .net2.0 in 32 bit machine. i am using a windows service inside the .msi installer file.when i run this .msi file in 32 bit machine it worked fine. when i run in the 64 bit mahcine windows service is not getting started.

Cannot open LP service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied





请给我建议解决方案.


谢谢
Jaya





Please Suggest me for the solution.


Thanks
Jaya

推荐答案

尝试专门为64位系统编译服务:

-在解决方案资源管理器中右键单击您的服务项目
-选择属性
-选择构建"标签
-将平台目标"下拉菜单设置为"x64"
-重新编译服务,重新创建安装程序,然后尝试再次安装

请注意:以这种方式编译服务时,它将无法在32位系统上运行,因此您需要编译和部署两个不同的版本.

另外:如果您的64位服务使用为32位系统编译的第三方dll,则在尝试加载dll时会抛出异常

祝你好运,
Johnny J.
Try compiling your service specifically for 64 bit systems:

-Right click your service project in the solution explorer
-Choose Properties
-Select the "Build" tab
-Set the "Platform Target" dropdown to "x64"
-Recompile your service, recreate the installer and try installing it again

Please note: When the service is compiled this way, it will not run on 32 bit systems, so you need to compile and deploy two different versions.

Also: If your 64 bit service makes use of 3rd party dll''s that are compiled for 32 bit systems, it will throw an exception when it tries to load the dll''s

Good luck,
Johnny J.


有两个选项:

使用corflags设置32位功能:
将程序集名称标记为/32Bit +

将该应用程序编译为任何CPU.
There are two options:

Use corflags to set 32 bit capability:
corflags assemblyname /32Bit+

Compile the application as Any CPU.


这篇关于如何在32位计算机中创建的64位计算机中运行Windows服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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