CruiseControl.NET 作为 Windows 服务运行和作为独立进程运行的行为不同

发布于 2024-09-01 03:09:17 字数 597 浏览 2 评论 0原文

我有一个正在使用 CruiseControl.NET 构建的项目。该项目包含一个“MSBuild 任务”,它运行项目的构建以及单元测试。单元测试又只是一个运行可执行文件的 MSBuild“exec”任务。

单元测试涉及一些 .NET 远程处理。当通过系统命令提示符运行单元测试时,软件的窗口将打开,测试将运行并退出进程。

当我通过 Web 仪表板强制构建时,构建会挂在单元测试开始运行的位置。软件的窗口未打开,但可执行文件正在运行。如果通过任务资源管理器终止进程,则构建会以“失败”状态进行。当我将 ccnet 作为 Windows 服务运行时会发生这种情况。

如果我直接运行 CCNet(不是作为 Windows 服务)并通过 Web 仪表板强制构建,则构建和单元测试会按预期顺利进行。 (软件窗口打开。)

看起来,CCNet 作为 Windows 服务运行时出现了死锁。我猜它与标准输出/错误流有关。

  1. 这是已知问题吗?

  2. 可能出现什么问题?

  3. 关于调试这个有什么建议吗?

  4. 我怎样才能绕过它?

(我使用的是CCNet版本1.4.4 SP1)

I have a project that is being built using CruiseControl.NET. The project contains an 'MSBuild task' that runs the build for the project and also the unit tests. The unit test in turn is just a MSBuild 'exec' task that runs an executable.

The unit test involves some .NET remoting. And when the unit tests are run through the system command prompt, the software's window opens up, tests run and the process exits.

When I force a build through the web dashboard, the build hangs at the point where the unit test starts running. The software's window does not open up, but the executable is running. If the process is killed through the task explorer, the build goes through with a 'Failure' status. This happens when I run ccnet as a windows service.

If I run CCNet directly (not as a windows service) and force a build through the web dashboard, the build and unit tests go through fine as expected. (with the window of the software opening up.)

It looks like there is a deadlock in the case where CCNet is run as a windows service. I am guessing it is related to the standard output/error streams.

  1. Is this is known problem?

  2. What might be the problem going on?

  3. Any suggestions on debugging this?

  4. How can I get around it?

(I am using CCNet version 1.4.4 SP1)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无声情话 2024-09-08 03:09:17

当 CCNet 作为服务运行时,它无法访问显示屏,因此不要指望在此配置中在屏幕上看到任何内容。我要检查的第一件事是权限 - 确保服务作为有权访问您需要的任何资源的帐户运行。您还可以通过仪表板找到 CCNet 日志文件。

顺便说一句,尝试 TeamCity 而不是 CCNet,它领先 10 年。

When CCNet is running as a service it is not going to have access to the display, so don't expect to see anything on the screen in this configuration. The first thing I would check is the permissions - make sure the service runs as an account that has permissions to access whatever resources you need. You also have CCNet log files, which you can find via Dashboard.

On a side note, try TeamCity instead of CCNet, its 10 years ahead.

哑剧 2024-09-08 03:09:17

也许这个答案会有所帮助:
delphi windows服务无法从互联网下载文件

您应该知道,当 CCNet 作为应用程序(dosbox)运行时,它使用环境变量和来自登录帐户的所有权限。因此它可以连接到服务器,使用缓存的密码,获取该帐户的注册表变量。

但是当作为服务运行时,该帐户是您提供的帐户:例如 LocalSystem,其中 env.变量并不相同。

所以,你可以做的是更改CCNet服务帐户进行测试。将其更改为您的用户帐户(带密码),我相信它会工作得更好!

Maybe this answer will help :
delphi windows service can't download file from internet

You should know that when running CCNet as an application (the dosbox) it uses the environment variables and all rights from the logged account. So it may connect to a server, use cached passwords, get registry variables for this account.

BUT when ran as a service, the account is the one you provided : LocalSystem for exampe, where env. varibales are not the same.

So, what you can do is to change the CCNet service account for test. Change it to your user account (with password), and I'm sure it will work better !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文