1

当我尝试通过 Worker 部署到 Azure 时,出现以下异常:

应用程序:WaWorkerHost.exe 框架版本:v4.0.30319 描述:进程因未处理的异常而终止。异常信息:Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentException 堆栈:在 Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.b__0() 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System .Object, Boolean) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading .ContextCallback, System.Object) 在 System.Threading.ThreadHelper.ThreadStart()

有人可以帮我解决这个问题吗?

更新:

我设法获得了有关异常的更多信息:

进程 ID:3320 进程名称:WaWorkerHost 线程 ID:4 AppDomain 未处理角色 XYZ.Worker_IN_0 异常异常:Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName) 出现错误

4

1 回答 1

2

正如@sharptooth 指出的那样,如果您尝试使用以下方式读取设置,则可能会发生这种情况:

CloudConfigurationManager.GetSetting("settingname") 

ServiceConfiguration.[Cloud].csdef 文件中没有名为“settingname”的设置。若要找出未找到哪个设置,请从 Visual Studio 的调试器中运行工作程序,并启用第一次机会异常。

请注意,在调试器中本地运行工作程序时,您应该检查 ServiceConfiguration.Local.cscfg 的设置。

于 2015-09-02T00:05:20.827 回答