网络工作 "host is not running"。如何调试?

WebJob "host is not running". How to debug?

Azure 网站 WebJob 在线,没有部署错误,并且在 WebJob SCM 控制台上对于已部署的 WebJobs 在任何级别都没有可见错误,除了:"host not running" 和一些模糊信息(见下文)。我可以在 VisualStudio 2015 中本地启动 WebJob 并且它 运行s 完美,但是我无法将调试器附加到已部署的 WebJob。 "parent" MVC 5 网站 运行 可以用作 Azure 网站,我可以将调试器附加到它的控制器上。

在这种情况下,"host not running" 是什么意思,how/where 我能最好地找出问题所在吗?

我在 SCM 控制台中也得到以下内容,但我不确定 运行 csc 命令在哪里。此外,我在我的网站配置中打开了详细的应用程序日志记录 table,这可能会提供更多信息。

[08/27/2015 19:49:52 > 62f8a0: SYS ERR ] Job failed due to exit code 1
[08/27/2015 19:49:52 > 62f8a0: SYS INFO] Process went down, waiting for 60 seconds
[08/27/2015 19:49:52 > 62f8a0: SYS INFO] Status changed to PendingRestart
[08/27/2015 19:50:57 > 62f8a0: SYS INFO] Run script 'csc.exe' with script host - 'WindowsScriptHost'
[08/27/2015 19:50:57 > 62f8a0: SYS INFO] Status changed to Running
[08/27/2015 19:50:58 > 62f8a0: INFO] Microsoft (R) Visual C# Compiler version 1.0.0.50618
[08/27/2015 19:50:58 > 62f8a0: INFO] Copyright (C) Microsoft Corporation. All rights reserved.
[08/27/2015 19:50:58 > 62f8a0: INFO] 
[08/27/2015 19:50:58 > 62f8a0: INFO] warning CS2008: No source files specified.
[08/27/2015 19:50:58 > 62f8a0: INFO] error CS1562: Outputs without source must have the /out option specified
[08/27/2015 19:50:58 > 62f8a0: SYS ERR ] Job failed due to exit code 1
[08/27/2015 19:50:58 > 62f8a0: SYS INFO] Process went down, waiting for 60 seconds
[08/27/2015 19:50:58 > 62f8a0: SYS INFO] Status changed to PendingRestart

发布的网络作业中似乎有 csc.exe 文件。您可以通过检查来自 DebuConsole.

的网络作业文件夹 D:\home\site\wwwroot\App_Data\jobs\continuous\<jobName> 来验证

当 webjob 运行 的逻辑试图找到 运行 的可执行文件时,它将按字母顺序遍历它们。如果您的 webjob 中需要 csc.exe 但该 webjob 实际上位于不同的 exe 中,则包含一个名为 run.cmd 的文件,该文件 运行 是您的 exe。 run.* 永远优先于任何事情。