0
votes

When attempting to start the debugger on an otherwise perfectly functional Azure project, what can cause the following exception to occur?

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:

1
Common cause is a read-only web.config. See msdn.microsoft.com/en-us/library/gg494981.aspx. - user94559

1 Answers

0
votes

For me, the problem was that my startup project for debugging was set to the package project (i.e. the project containing the service definition files) rather than one of my web roles. (This got reset when I changed machines.) Right-clicking on a web role and selecting "Set as StartUp Project" fixed the error.

In case you don't notice the comment above, @smarx also mentions that a common cause for the same error is a read-only web.config file and points to http://msdn.microsoft.com/en-us/library/gg494981.aspx. That same link mentions a couple other related causes too.