gpt4 book ai didi

azure - .NET 5.0 Webjob 不再从独立构建开始

转载 作者:行者123 更新时间:2023-12-02 05:52:46 25 4
gpt4 key购买 nike

由于 .NET 5.0,我将我的构建切换为独立的。我知道有一个预览运行时,但我不想在我的生产环境中押注于此。我遇到过预览运行时无意中切换回来的情况(例如横向扩展)。

dotnet publish --configuration release --self-contained true --runtime win-x64

完成独立构建后,我的网络作业不再启动。在查看日志时,我发现了这一点:

[12/22/2020 16:36:05 > 62427f: SYS INFO] Detected WebJob file/s were updated, refreshing WebJob
[12/22/2020 16:36:05 > 62427f: SYS INFO] Status changed to Starting
[12/22/2020 16:36:05 > 62427f: SYS INFO] WebJob singleton setting is False
[12/22/2020 16:36:07 > 62427f: SYS INFO] Run script 'createdump.exe' with script host - 'WindowsScriptHost'
[12/22/2020 16:36:07 > 62427f: SYS INFO] Status changed to Running
[12/22/2020 16:36:35 > 62427f: ERR ] createdump [options] pid
[12/22/2020 16:36:35 > 62427f: ERR ] -f, --name - dump path and file name. The default is '%TEMP%\dump.%p.dmp'. These specifiers are substituted with following values:
[12/22/2020 16:36:35 > 62427f: ERR ] %p PID of dumped process.
[12/22/2020 16:36:35 > 62427f: ERR ] %e The process executable filename.
[12/22/2020 16:36:35 > 62427f: ERR ] %h Hostname return by gethostname().
[12/22/2020 16:36:35 > 62427f: ERR ] %t Time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
[12/22/2020 16:36:35 > 62427f: ERR ] -n, --normal - create minidump.
[12/22/2020 16:36:35 > 62427f: ERR ] -h, --withheap - create minidump with heap (default).
[12/22/2020 16:36:35 > 62427f: ERR ] -t, --triage - create triage minidump.
[12/22/2020 16:36:35 > 62427f: ERR ] -u, --full - create full core dump.
[12/22/2020 16:36:35 > 62427f: ERR ] -d, --diag - enable diagnostic messages.
[12/22/2020 16:36:36 > 62427f: SYS ERR ] Job failed due to exit code -1
[12/22/2020 16:36:36 > 62427f: SYS INFO] Process went down, waiting for 60 seconds
[12/22/2020 16:36:36 > 62427f: SYS INFO] Status changed to PendingRestart

这个createdump日志输出是什么意思?

最佳答案

进行独立构建时,您的构建输出文件夹将包含一个 createdump.exe 文件。将 WebJob 部署到应用服务时,它现在将选择此 .exe 而不是您的 WebJob。这就是日志显示 createdump.exe 的 CLI 输出的原因。

解决方法:创建一个仅包含 mywebjob.exe 名称的 run.cmd 文件。

https://github.com/projectkudu/kudu/wiki/WebJobs

  • Per file type we look first for a file named: run.{file type extension} (for example run.cmd or run.exe).
  • If it doesn't exists for all file types, we'll then look for the first file with a supported file type extension.
  • The order of file types extension used is: .cmd, .bat, .exe, .ps1, .sh, .php, .py, .js.
  • The recommended script file to have in your job directory is: run.cmd.
  • Note: We'll only look for a script under the root directory of that job (not under sub directories of it).
  • Note: make sure .bat/.cmd files don't include the UTF-8 BOM (inserted by some editors such as Visual Studio by default), which can break things!

PS:您不能简单地删除createdump.exe,因为您的应用程序将not start without it 。编辑:如果您使用 net6 或更高版本,您现在可以删除该文件。

关于azure - .NET 5.0 Webjob 不再从独立构建开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65413119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com