B
B
bagos2017-09-11 15:02:16
C++ / C#
bagos, 2017-09-11 15:02:16

How to solve the CommunicationException error problem?

I need to change the server address in rantom. I do it like below:

var baseAddress = new Uri(ArchiveStorage.Instance.Control.BaseAddress + "/StorageService");
            var endPoint = new EndpointAddress(baseAddress);
            var myBinding = new WSHttpBinding { Name = "WSHttpBinding_IArchiveStorageControl" };
Instance = new ArchiveStorageControlClient(myBinding, endPoint);

Works correctly on clean machines. On downloaded by other programs, the error below creeps out
2017-09-11 05:53:53.6497| Error | ArchiveStorageControlModel | Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))mscorlib
Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

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 Gramma.Storage.Console.Wpf.ArchiveControlServiceReference.IArchiveStorageControl.GetDrives()
   at Gramma.Storage.Console.Wpf.ArchiveControlServiceReference.ArchiveStorageControlClient.GetDrives()
   at Gramma.Storage.Console.Wpf.StorageClient.GetDrives()
   at Gramma.Storage.Console.Wpf.ArchiveStorageControlModel..ctor() System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at Amico.Sys.CDBurn.IDiscRecorder2.InitializeDiscRecorder(String recorderUniqueId)
   at Amico.Sys.CDBurn.ImageBurn.GetSystemDevicesList()
   at Amico.Sys.CDBurn.ImageBurn.get_SystemDevicesList()
   at Gramma.Storage.ArchiveServer.ArchiveStorageControl.GetDrives()
   at SyncInvokeGetDrives(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& r...).

Initially, the service reference is set to a different address-port, then both the server and the client take information about the new address and port from the config file at startup.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2017-09-11
@Sumor

Most likely you have a port that is used by the server is already occupied by other programs.
A port on a computer is an exclusive resource available only to one program (which first reserved it).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question