谜我这个 [英] Riddle Me This

查看:60
本文介绍了谜我这个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的。


有人可以解释一下为什么一个Windows服务,当在Debug

模式下编译时,

没有问题以其中一种方法启动可执行程序



exe执行它应该做的事情。


但是,当服务是使用installutil安装的,exe失败了。


为什么会这样???

谢谢。

OK.

Can somebody explain why a windows service, when compiled in Debug
mode,
has no problem starting an executable program in one of its methods
and the
exe does what it is supposed to.

But, when the service is installed using installutil the exe fails.

Why might that be??

Thanks.

推荐答案

" pbd22" < du ***** @ gmail.com写信息

新闻:dd ************************* ********* @ f47g2000 hsd.googlegroups.com ...
"pbd22" <du*****@gmail.comwrote in message
news:dd**********************************@f47g2000 hsd.googlegroups.com...

OK。


可以有人解释为什么一个Windows服务,当在Debug

模式下编译时,

在其中一个方法中启动可执行程序没有问题



exe做了它应该做的事情。


但是,当使用installutil安装服务时,exe失败了。


为什么会这样?
OK.

Can somebody explain why a windows service, when compiled in Debug
mode,
has no problem starting an executable program in one of its methods
and the
exe does what it is supposed to.

But, when the service is installed using installutil the exe fails.

Why might that be??



不太确定,但我不认为服务应该启动exe。什么
如果没有人登录,会发生
?如果2人登录会怎么样?什么

账户下的exe是什么?


Michael

Not really sure but I don''t think a service should start an exe. What
happens if no-one is logged in? What happens if 2 people are logged in? What
account does the exe run under?

Michael


LocalSystem。


它确实在调试模式下启动了这个exe - 实际上相当不错。

不确定你的意思是没人登录。

它在启动时自动启动。


我将exe放在C:/ bin


这是一个由C#服务调用的VB6项目。
LocalSystem.

It does start this exe in Debug mode - quite nicely, actually.
Not sure what you mean by "nobody logged in".
It starts automatically at boot.

I put the exe in C:/bin

It is a VB6 project called by a C# service.


更可能的是,您自己运行服务可执行文件

,这可能具有提升的权限。当您将其作为

服务安装时,默认为LocalService帐户(我相信),而不是
具有相同的权限。新流程在产生它的

流程的用户下运行。


如果您将服务设置为在您的用户帐户下运行,我敢打赌它会

工作。不过你应该这样做。相反,您应该找到服务运行所需的应用程序的

权限,然后创建一个具有相应权限的帐户



-

- Nicholas Paldino [.NET / C#MVP]

- mv *@spam.guard.caspershouse.com

" pbd22" < du ***** @ gmail.com写信息

新闻:dd ************************* ********* @ f47g2000 hsd.googlegroups.com ...
More likely than not, you are running the service executable as
yourself, which probably has elevated permissions. When you install it as a
service, it defaults to the LocalService account (I believe) which does not
have the same permissions. The new process runs under the user of the
process that spawned it.

If you set the service to run under your user account, I bet it would
work. Not that you should do this, though. Rather, you should find out the
permissions the app that the service runs needs, and then create an account
that has the appropriate permissions.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"pbd22" <du*****@gmail.comwrote in message
news:dd**********************************@f47g2000 hsd.googlegroups.com...

OK。


可以有人解释为什么一个Windows服务,当在Debug

模式下编译时,

在其中一个方法中启动可执行程序没有问题



exe做了它应该做的事情。


但是,当使用installutil安装服务时,exe失败了。


为什么会那样?


谢谢。
OK.

Can somebody explain why a windows service, when compiled in Debug
mode,
has no problem starting an executable program in one of its methods
and the
exe does what it is supposed to.

But, when the service is installed using installutil the exe fails.

Why might that be??

Thanks.


这篇关于谜我这个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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