.net - Calling a remote COM+ ServicedComponent from a C# client -


I have a serviced component installed in a COM + server application. I want to create an instance from a remote client, the client should be able to dynamically specify the name of the server machine. How do I do this?

I try to use the catalyst:

  (XSLTransComponent.XSLTransformer) Activator.GetObject (typeof (XSLTransComponent.XSLTransformer), Servername) ;  

But I can find this:

System.Runtime.Remoting.RemotingException: Creating channel sync can not connect to the 'server' URL. An appropriate channel may not have been registered. System.Runtime.Remoting.RemotingServices.Unmarshal (type classToProxy, string url, object data)

Do I need to register a channel? If so, then how?

Another idea is to use Marshall. Bindtomonicator, but how do I specify a monitor for the remote object hosted on COM + on the server?

Eureka! This works:

  string serverName = serverTextBox.Text; Type remote = Type.GetTypeFromProgID ("XSLTransComponent.XSLTransformer", ServerName); Return (XSLTransComponent.XSLTransformer) Activator.CreateInstance (Remote);  

thanks


Comments