System.ServiceModel.Channels.ServiceChannel exception during ASP.NET application upgrade from Windows Azure SDK 1.2 to 1.3

When
you upgrade your ASP.NET based application from Windows Azure SDK 1.2 to 1.3 it
is possible you may hit the following exception:

System.ServiceModel.CommunicationObjectFaultedException was unhandled

 Message=The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

 Source=mscorlib

  StackTrace:

    Server stack trace:

       at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)

    Exception rethrown at [0]:

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

       at System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)

       at System.ServiceModel.ClientBase'1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)

       at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[] args)

  InnerException:

 

This is a known issue with Windows Azure SDK 1.3
when ASP.NET based application is upgraded from SDK 1.2 to 1.3. 

There
are two potential causes for such problem as below:

1. Web.config
file marked read-only in compute emulator

2. Multiple role instances writing to same
configuration file in compute emulator

The problem is described in details along with potential workaround at:

https://msdn.microsoft.com/en-us/library/gg494981.aspx

 

Please refer the following link for another potential issue when upgrading Windows Azure SDK 1.2 to 1.3

https://blogs.msdn.com/b/windowsazure/archive/2010/12/08/specifying-machine-keys-with-windows-azure-sdk-1-3.aspx

https://blogs.msdn.com/b/avkashchauhan/archive/2010/12/07/upgrading-asp-net-web-role-to-cloud-sdk-1-3-from-sdk-1-2-may-cause-form-authentication-broken-or-log-in-issues.aspx