Hello all - I am trying to set up a service on an old Widnows 2008 Server machine. Basically, I have a socket listener that connects to a client, the client makes a request. The request goes to the interop library, and it then throws the exception. The interop assembly basically accesses an application that is running on said machine. I created a console application that ran the server, and this functioned fine.
Whenever I make a call to an interop library I get the following exception:
System.InvalidCastException: Unable to cast COM object of type 'Csnt.ComDORTClass' to interface type 'Csnt.IComDORTClass'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8C6A0426-E3F2-11CF-B34A-00AA003C435E}' failed due to the following error: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA).
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Csnt.ComDORTClass.WriteDataItem(String lpcstrTagName, Int32 lValue)
at ComIntopCall.TrySetFlag(String strTagName, Boolean blnValue)
at IO.SomeService.ProcessWrite(String tag, String value, String type)
at Service.OnStart(String[] args)
I tried adding some rules to the firewall but that does not seem to have made much of a difference with the service still throwing the excecptions. The RPC service is running as well. The calls from the service are calling a local library.