【Azure Cloud Service】部署云服务时候遇见 Last exit code: 0. Last role exception: (System.IO.FileNotFoundException) 错误

简介: 【Azure Cloud Service】部署云服务时候遇见 Last exit code: 0. Last role exception: (System.IO.FileNotFoundException) 错误

问题描述

部署云服务时候遇见 Last exit code: 0. Last role exception: (System.IO.FileNotFoundException) 错误,提示无法加载System.Runtime。

Recovering role... Application startup task 0 finished successfully. 
Last exit time: [2024/03/27, 20:23:31.142]. Last exit code: 0. Last role exception: (System.IO.FileNotFoundException)|>Process ID: 221
Process Name: WaIISHost
Thread ID: 1
AppDomain Unhandled Exception for role WebApiWebRole_IN_0
Exception: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at WebApiWebRole.WebRole.OnStart()
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
   at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

 

 

问题解答

原因 2:DLL 或程序集缺失

(Source: https://learn.microsoft.com/zh-cn/troubleshoot/azure/cloud-services/extended/role-startup-failure#cause-2-dlls-or-assemblies-are-missing)

无响应的角色实例和在状态之间循环的角色实例可能是由于缺少 DLL 或程序集而导致的。

下面是缺少 DLL 或程序集的一些症状:

  • 角色实例将循环访问 “正在初始化”、“ 忙碌”和 “正在停止” 状态。
  • 角色实例已移至 “就绪” 状态,但页面在 Web 应用程序中不可见。

根据云服务的排查 " DLL 或程序集缺失 " 的文档,排查没有Dll遗漏,所以还是没有解决此问题。

最后,把启动项变更为 webRole 后,部署成功。但确实没有道理,因为Project中的启动项设置与打包后的部署文件并没有关系。

PS: 。。。 一直在困惑中 。。。

 

参考资料

排查 Azure 云服务中的角色实例启动失败问题  : https://learn.microsoft.com/zh-cn/troubleshoot/azure/cloud-services/extended/role-startup-failure#cause-2-dlls-or-assemblies-are-missing

相关文章
POST 请求出现异常!java.io.IOException: Server returned HTTP response code: 400 for URL
POST 请求出现异常!java.io.IOException: Server returned HTTP response code: 400 for URL
4264 0
|
6月前
|
消息中间件 Java Kafka
zookeeper:Unexpected exception, exiting abnormally ::java.io.EOFException
zookeeper:Unexpected exception, exiting abnormally ::java.io.EOFException
182 1
zookeeper:Unexpected exception, exiting abnormally ::java.io.EOFException
|
8月前
|
XML Java Maven
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
211 0
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
|
5月前
|
NoSQL Java Redis
【Azure Spring Cloud】Java Spring Cloud 应用部署到Azure上后,发现大量的 java.lang.NullPointerException: null at io.lettuce.core.protocol.CommandHandler.writeSingleCommand(CommandHandler.java:426) at ... 异常
【Azure Spring Cloud】Java Spring Cloud 应用部署到Azure上后,发现大量的 java.lang.NullPointerException: null at io.lettuce.core.protocol.CommandHandler.writeSingleCommand(CommandHandler.java:426) at ... 异常
|
8月前
|
NoSQL Java Redis
【问题篇】解决Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException
【问题篇】解决Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException
2556 0
|
缓存 NoSQL Redis
java.io.IOException: java.lang.RuntimeException: unable to find class for code 253
原因: 跟踪了一下所调用的底层接口,发现是redis缓存的问题,登录redis,刷新redis
130 0
|
NoSQL Java Redis
Redis - Redis command timed out nested exception is io.lettuce.core.RedisCommandTimeoutException
Redis - Redis command timed out nested exception is io.lettuce.core.RedisCommandTimeoutException
3240 0
Exception in thread main java.io.NotSerializableException
Exception in thread main java.io.NotSerializableException
112 0
Exception in thread main java.io.NotSerializableException
Exception in thread “main“ java.io.IOException: Could not find resource mybatis-config.xml
Exception in thread “main“ java.io.IOException: Could not find resource mybatis-config.xml
Exception in thread “main“ java.io.IOException: Could not find resource mybatis-config.xml