I have a CLSID and I need to instantiate this in a Different server (i.e. DCS ) where as my working machine is (i.e. MWS ).
Now, if I use following :
var type = Type.GetTypeFromCLSID(new Guid(CLSID),
Environment.MachineName, true);
var COMObject = Activator.CreateInstance(type);
var returnValue = COMObject.GetType().InvokeMember(methodName,
flags, null, COMObject, args, argModifiers, null, null);
Then I get "COM target does not implement IDispatch" error. Ok, I understand that probably the COM target object doesn't have the IDispatch, so it fails.
Now then tried something else, If I add a reference of that COM DLL in VS, then VS generate the interop assemblies and then everything works like regular .net object creation, but in that case the object is actually generating in my local machine (MWS pc) not into the server what I want.
Guys any suggestion how can I deal this situation?
Thanks in advance.