Windows Azure Worker Role Exception: System.Runtime.Fx+IOCompletionThunk.UnhandledExceptionFrame

If
you have a worker role crashing with the following exception details, it is
possible I have solution for you:

 

Application: WaWorkerHost.exe

Framework Version: v4.0.30319

Description: The process was terminated due
to an unhandled exception.

Exception Info: System.Runtime.CallbackException

Stack:

   at
System.Runtime.Fx+IOCompletionThunk.UnhandledExceptionFrame(UInt32, UInt32,
System.Threading.NativeOverlapped*)

   at
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32,
UInt32, System.Threading.NativeOverlapped*)

 

If
you further debug this issue you will see more details on this exception as
below:

Microsoft.WindowsAzure.ServiceRuntime Critical: 1 : Unhandled Exception:

System.InvalidProgramException: Common Language Runtime detected an invalid program.

   at System.ServiceModel.Dispatcher.ErrorBehavior.HandleErrorCommon(Exception error, ErrorHandlerFaultInfo& faultInfo)

   at System.ServiceModel.Dispatcher.ChannelDispatcher.HandleError(Exception error, ErrorHandlerFaultInfo& faultInfo)

   at System.ServiceModel.Dispatcher.ChannelHandler.HandleError(Exception e)

   at System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump()

   at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)

   at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)

   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Microsoft.WindowsAzure.ServiceRuntime Critical: 1 : Unhandled Exception:

System.InvalidProgramException: Common Language Runtime detected an invalid program.

   at System.ServiceModel.Dispatcher.ErrorBehavior.HandleErrorCommon(Exception error, ErrorHandlerFaultInfo& faultInfo)

   at System.ServiceModel.Dispatcher.ChannelDispatcher.HandleError(Exception error, ErrorHandlerFaultInfo& faultInfo)

   at System.ServiceModel.Dispatcher.ChannelHandler.HandleError(Exception e)

   at System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump()

   at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)

   at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)

   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

(a64.69c): CLR exception - code e0434352 (first chance)

 

Possible Reason for this
issue:

Based
on investigation what we found is that the problem is caused by a known issue with
Visual Studio 2010 RTM base libraries.

Solution:

The
above problem is fixed in Visual Studio 2010 SP1. Please install Visual
Studio 2010 SP1 (VS1010 SP1) and recompile the Windows Azure Application. After it you can test Worker Role in
development fabric and Windows Azure.

Note:
This issue is also reference below:

https://social.msdn.microsoft.com/Forums/en-ZA/windowsazuretroubleshooting/thread/543da280-2e5c-4e1a-b416-9999c7a9b841