无法将.net 5程序作为Azure WebJob执行

编程入门 行业动态 更新时间:2024-10-21 09:36:39
本文介绍了无法将 5程序作为Azure WebJob执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 5命令行程序,我试图按计划在Azure上以webjob的身份执行该程序.我可以在本地执行它而不会出现问题,但是在Azure上执行时,我得到:

[2020年12月14日21:28:03>83e1e9:SYS INFO]状态更改为正在初始化"[12/14/2020 21:28:10>83e1e9:SYS INFO]使用脚本宿主-"WindowsScriptHost"运行脚本"ApplySupportTool.ServerTasks.exe"[12/14/2020 21:28:11>83e1e9:SYS INFO]状态更改为正在运行"[12/14/2020 21:28:11>83e1e9:错误]无法找到任何兼容的框架版本[12/14/2020 21:28:11>83e1e9:错误]找不到框架'Microsoft.NETCore.App',版本'5.0.0'.[12/14/2020 21:28:11>83e1e9:ERR]-找到以下框架:[12/14/2020 21:28:11>83e1e9:ERR] 2.2.14,位于[D:\ Program Files \ dotnet \ shared \ Microsoft.NETCore.App][12/14/2020 21:28:11>83e1e9:ERR] 3.0.3 at [D:\ Program Files \ dotnet \ shared \ Microsoft.NETCore.App][12/14/2020 21:28:11>83e1e9:ERR] 3.1.8 at [D:\ Program Files \ dotnet \ shared \ Microsoft.NETCore.App][12/14/2020 21:28:11>83e1e9:ERR][12/14/2020 21:28:11>83e1e9:ERR]您可以通过安装指定的框架和/或SDK来解决此问题.[12/14/2020 21:28:11>83e1e9:ERR][12/14/2020 21:28:11>83e1e9:ERR]可在以下位置找到指定的框架:[12/14/2020 21:28:11>83e1e9:错误]-aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=win10-x64[12/14/2020 21:28:11>83e1e9:SYS INFO]状态更改为失败"[12/14/2020 21:28:11>83e1e9:SYS ERR]作业由于退出代码-2147450730而失败

但是根据我在这里看到的内容:

  • 为后台网络作业安装扩展程序.

  • 您也可以转到kudu进行扩展程序安装.

  • I have a 5 command line programm which I try to execute on a schedule as webjob on Azure. I can execute it without issues locally, but when execute on Azure I get:

    [12/14/2020 21:28:03 > 83e1e9: SYS INFO] Status changed to Initializing [12/14/2020 21:28:10 > 83e1e9: SYS INFO] Run script 'ApplySupportTool.ServerTasks.exe' with script host - 'WindowsScriptHost' [12/14/2020 21:28:11 > 83e1e9: SYS INFO] Status changed to Running [12/14/2020 21:28:11 > 83e1e9: ERR ] It was not possible to find any compatible framework version [12/14/2020 21:28:11 > 83e1e9: ERR ] The framework 'Microsoft.NETCore.App', version '5.0.0' was not found. [12/14/2020 21:28:11 > 83e1e9: ERR ] - The following frameworks were found: [12/14/2020 21:28:11 > 83e1e9: ERR ] 2.2.14 at [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] [12/14/2020 21:28:11 > 83e1e9: ERR ] 3.0.3 at [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] [12/14/2020 21:28:11 > 83e1e9: ERR ] 3.1.8 at [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] [12/14/2020 21:28:11 > 83e1e9: ERR ] [12/14/2020 21:28:11 > 83e1e9: ERR ] You can resolve the problem by installing the specified framework and/or SDK. [12/14/2020 21:28:11 > 83e1e9: ERR ] [12/14/2020 21:28:11 > 83e1e9: ERR ] The specified framework can be found at: [12/14/2020 21:28:11 > 83e1e9: ERR ] - aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=win10-x64 [12/14/2020 21:28:11 > 83e1e9: SYS INFO] Status changed to Failed [12/14/2020 21:28:11 > 83e1e9: SYS ERR ] Job failed due to exit code -2147450730

    But from what I read here: azure.github.io/AppService/2020/11/10/Dot-Net-5-on-App-Service.html 5 is already available through all regions. Also, my 5 asp core web api project works without issues on the same app service. I also tried to install it explicitly via the ASP.NET Core 5.0 (x86) Runtime, but with no different result. I know that I can publish it as self contained. Given the size increase I would prefer to use the installed version though.

    解决方案

    Here are some operation might help.

  • Explicitly configure your App Service to use the .NET 5 stack.

  • Install extensions for background webjob.

  • You can also go to kudu for extensions installation.

  • 更多推荐

    无法将.net 5程序作为Azure WebJob执行

    本文发布于:2023-11-14 04:28:01,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1586220.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:程序   net   WebJob   Azure

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!