c# - Azure WebJobs 支持的 .Net Framework 版本吗?

标签 c# asp.net azure azure-webjobs

我有两个独立的 Azure Web 应用程序,每个应用程序都有一个连续运行的 Web 作业。将 C# 项目升级到 4.6.1 后,我将站点发布到 Azure,它们继续像 webjobs 一样工作。

我注意到配置有一个不同的 httpRuntime 版本来调试下面的版本,所以我更改了它们

  <system.web>
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.5.1" maxRequestLength="30720" />
...
 </system.web>

  <system.web>
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" maxRequestLength="30720" />
...
 </system.web>

发布网络应用程序和相应的网络作业后,它们仍然可以工作。

但是在更改 webjobs 应用程序配置后

   <configuration>
     <startup> 
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
     </startup>
    </configuration>

  <configuration>
     <startup> 
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
     </startup>
    </configuration>

每次我重新发布或停止并启动时,两个网络作业都会恢复为待启动状态。日志显示错误

[02/12/2016 19:48:35 > 686340: SYS INFO] Detected WebJob file/s were updated, refreshing WebJob
[02/12/2016 19:48:35 > 686340: SYS INFO] Status changed to Stopping
[02/12/2016 19:48:35 > 686340: SYS INFO] Status changed to Stopped
[02/12/2016 19:48:35 > 686340: SYS INFO] Status changed to Starting
[02/12/2016 19:48:35 > 686340: SYS INFO] Run script 'Timbo.Azure.Worker.exe' with script host - 'WindowsScriptHost'
[02/12/2016 19:48:35 > 686340: SYS INFO] Status changed to Running
[02/12/2016 19:48:35 > 686340: SYS ERR ] Job failed due to exit code -2146232576
[02/12/2016 19:48:35 > 686340: SYS INFO] Process went down, waiting for 60 seconds
[02/12/2016 19:48:35 > 686340: SYS INFO] Status changed to PendingRestart
[02/12/2016 19:49:36 > 686340: SYS INFO] Run script 'Timbo.Azure.Worker.exe' with script host - 'WindowsScriptHost'
[02/12/2016 19:49:36 > 686340: SYS INFO] Status changed to Running
[02/12/2016 19:49:36 > 686340: SYS ERR ] Job failed due to exit code -2146232576
[02/12/2016 19:49:36 > 686340: SYS INFO] Process went down, waiting for 60 seconds
[02/12/2016 19:49:36 > 686340: SYS INFO] Status changed to PendingRestart

错误代码-2146232576非常没有帮助,特别是因为我无法在谷歌或此处找到任何内容来查找它。

恢复此设置,一切都会恢复正常。所以我的问题是为什么会发生这种情况,以及为什么使用此设置在本地(开发计算机)运行的 webjob 可以工作,但在框架设置(在 appsettings 中)显示 .Net 版本 4.6 的网站内的 azure 上却不能工作

最佳答案

更新:4.6.1 现已部署

网络应用虚拟机尚不支持 4.6.1:

Microsoft connect issue

Git hub issue

关于c# - Azure WebJobs 支持的 .Net Framework 版本吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35371522/

相关文章:

c# - C#中套接字的列表或ArrayList

c# - 显示 .gif 并在访问服务器期间继续播放 - asp .net

rest - 为 Azure Rest webapi 应用程序启用 CORS

c# - 通过 Azure 函数的 SQL 连接仅适用于本地主机

c# - 使用 ExpressionVisitor 修改表达式以进行自动翻译

c# - 在 PhantomJS Selenium Webdriver 中关闭 INFO

c# - Windows 桌面搜索 - 现在从命令行强制重新索引/索引

c# - 使用 jquery 调用 FormsAuthentication.SignOut() 方法

azure - 自动调整 Azure VM 镜像大小

c# - 如何根据下拉列表中选择的项目在隐藏字段中设置值