This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / .net问题:我有一个windows service project,其中有4个不同的services,生成不同的4个installer,安装后,启动任何一个windows service,却总是运行同一个service。请问如何解决。
-lilyba(sunshine困惑不懂装懂);
2003-12-28
(#1534259@0)
-
你不会service installer里面的名字一样吧?
-speed(如风);
2003-12-28
(#1534267@0)
-
在initialcomponent里面,每个me.installer.servicename都是不一样的。这是你说的么?而且我是每个service分别add installer. 谢谢。
-lilyba(sunshine困惑不懂装懂);
2003-12-28
(#1534279@0)
-
up
-lilyba(sunshine困惑不懂装懂);
2003-12-28
(#1534315@0)
-
一个windows services project 里面是不是不能存在几个services啊?
-lilyba(sunshine困惑不懂装懂);
2003-12-28
(#1534336@0)
-
Try to create 4 different projects in a solution or just one project for each service, 另外想问,不同的Services为什么放在同一个Project里呢?
-wjiaca(WSY);
2003-12-28
(#1534366@0)
-
I might got the answer, just testing it now. Putting them in one project, so you can install them once, and of course, it looks a little bit professional. :P
-lilyba(sunshine困惑不懂装懂);
2003-12-28
(#1534396@0)
-
目前我试着这样做,不过好像还是总是运行第一个service。<MTAThread()>_
shared sub main()
dim servicesToRun as serviceBase
servicesToRun=New ServiceBase(new service1, new service2, new service3, new service4)
servicebase.run(servicesToRun)
End sub
-lilyba(sunshine困惑不懂装懂);
2003-12-31
{195}
(#1538501@0)
-
I tried this method too. But I did not make it. I don't know if i did something wrong.
-lilyba(sunshine困惑不懂装懂);
2003-12-31
(#1538504@0)
-
dim servicesToRun as serviceBase 还是 dim servicesToRun() as serviceBase ?应该定义一个数组吧。试试:dim servicesToRun() as serviceBase
servicesToRun=New ServiceBase()(new service1, new service2, new service3, new service4)
-guestagain(guest again);
2003-12-31
{124}
(#1538520@0)
-
我就是这样的,一模一样。可是我打开service2时,还是总是运行sub main 所在的service1.
-lilyba(sunshine困惑不懂装懂);
2003-12-31
(#1538528@0)
-
From MSDN:You must set the service name of the service in the main() function of the executable. The service name that you set in main() must exactly match the ServiceName property of the service installer.
The URL you gave above should be the correct answer, I will try it tomorrow, I have to go.
-guestagain(guest again);
2003-12-31
{290}
(#1538537@0)
-
谢谢你,做个好梦。
-lilyba(sunshine困惑不懂装懂);
2003-12-31
(#1538541@0)
-
works for me here is the code.
-guestagain(guest again);
2003-12-31
(#1538546@0)
-
Service1.vb
-guestagain(guest again);
2003-12-31
{2533}
(#1538547@0)
-
Service2.vb
-guestagain(guest again);
2003-12-31
{1649}
(#1538548@0)
-
ProjectInstaller.vb
-guestagain(guest again);
2003-12-31
{2399}
(#1538549@0)