I have some setup & teardown scripts that use csrun.exe to prepare a local compute emulator for some automated tests.
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /removeall C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /devfabric:clean
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /run:"c:\myapp\csx\Release";"c:\myapp\bin\Release\app.publish\ServiceConfiguration.Local.cscfg"
The csrun call to removeall inconsistently fails with this error:
Encountered an unexpected error The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. 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.IDisposable.Dispose() at Microsoft.ServiceHosting.Tools.DevelopmentFabric.SingleInstanceFabricClient.Connect() at Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabric.EnsureClient(Boolean checkConnection) at Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabric.d__0.MoveNext() at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.RemoveAll() at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ParseArguments(String[] args, Boolean doActions) at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ExecuteActions(String[] args).
And the csrun call for deployment also inconsistently fails with the same error (slightly different stack trace):
Encountered an unexpected error The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. 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.IDisposable.Dispose() at Microsoft.ServiceHosting.Tools.DevelopmentFabric.SingleInstanceFabricClient.RunServiceDeployment(String tenantName) at Microsoft.ServiceHosting.Tools.DevelopmentFabric.Deployment.Start() at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.Run(DirectoryInfo dir, FileInfo serviceConfiguration, Boolean launchBrowser, Boolean paused, String debugger, Boolean useIISExpress, List`1 portOverrides) at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ParseArguments(String[] args, Boolean doActions) at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ExecuteActions(String[] args).
This is the Compute Emulator v2.4.
I've confirmed the web.config is writable and valid. (As suggested by this thread.)
I've had a similar setup working on another machine with no issues. The only difference I'm aware of is that the working machine has a single-core CPU while this failing one is dual-core.