我試圖部署.NET Core控制檯應用程序作爲Azure WebJob。所有文件等被複制到正確的目錄,但我的控制檯應用程序的輸出是一個.dll,所以它需要dotnet.exe
開始。在Azure WebJob中缺少dotnet.exe
我已經用單個命令添加了一個run.cmd文件:dotnet QbiSync.dll
。 但輸出如下,它似乎無法找到dotnet.exe:
[11/14/2016 13:15:29 > 4741da: SYS INFO] Run script 'run.cmd' with script host - 'WindowsScriptHost'
[11/14/2016 13:15:29 > 4741da: SYS INFO] Status changed to Running
[11/14/2016 13:15:29 > 4741da: INFO]
[11/14/2016 13:15:29 > 4741da: INFO] D:\local\Temp\jobs\continuous\QbiSync\x4jkoxww.vy4>dotnet QbiSync.dll
[11/14/2016 13:15:29 > 4741da: ERR ] 'dotnet' is not recognized as an internal or external command,
[11/14/2016 13:15:29 > 4741da: ERR ] operable program or batch file.
[11/14/2016 13:15:29 > 4741da: SYS ERR ] Job failed due to exit code 1
[11/14/2016 13:15:29 > 4741da: SYS INFO] Process went down, waiting for 60 seconds
開放使用捻或在Azure門戶網站和呼叫dotnet.exe
都工作正常,一個控制檯窗口。我也試着像硬鏈接:
"D:\Program Files (x86)\dotnet\dotnet.exe" QbiSync.dll
"\Program Files (x86)\dotnet\dotnet.exe" QbiSync.dll
但他們也給這樣的錯誤:
[11/14/2016 13:59:29 > 4741da: ERR ] The filename, directory name, or volume label syntax is incorrect.
[11/14/2016 13:59:29 > 4741da: INFO] D:\local\Temp\jobs\continuous\QbiSync\hzlkzj1q.0jt>"D:\Program Files (x86)\dotnet\dotnet.exe" QbiSync.dll
即使dotnet.exe實際上是設在那裏。
更新:
可能相關的是,源在腳本的開頭使用@echo off
。但這也是一個似乎並未被接受的「命令」。
[11/14/2016 12:37:57 > 4741da: INFO] D:\local\Temp\jobs\continuous\QbiSync\3n44nly1.ucq>@echo off
[11/14/2016 12:37:57 > 4741da: INFO]
[11/14/2016 12:37:57 > 4741da: ERR ] '@echo' is not recognized as an internal or external command,
來源用於:
如果您嘗試從Kudu Console手動運行run.cmd,會發生什麼情況? –
作爲一個快速測試,我嘗試用run.cmd創建一個連續的WebJob,它只有'dotnet.exe QbiSync.dll'(沒有dll)。 'D:\ local \ Temp \ jobs \ continuous \ DotNetContJob \ tgq45gw1.kb2 \ QbiSync.dll',這意味着它成功啓動了dotnet.exe並且只是因爲dll失敗而失敗不在這裏。你可以嘗試這個相同的測試來隔離嗎? –
@DavidEbbo使用'D:\ local \ Temp \ jobs \ continuous \ QbiSync \ jf0yv53s.i3c> run.cmd',使用kudu控制檯成功啓動並獲得預期輸出。我會在幾分鐘內檢查你的第二條評論。 – Raymen