serenarules — 2011-12-10T19:08:49-05:00 — #1
Basicly, what happened to the CreateObject(pid, host) version of this method in .NET 4.0 C#? I can't seem to locate any information at all on how to instantiate a COM+ service located on a remote server. The current version is HttpContext.Current.Server.CreateObject(pid) or (type), but you can't specify host. My guess is that I need to instantiate a HttpServerUtility for the required server, but I have no clue how to go about that. Any ideas?
serenarules — 2011-12-12T03:05:29-05:00 — #2
For those interested, the answer is:
// get a type by asking the remote server for it
Type type = Type.GetTypeFromProgId("Foo.Bar.Thing", "220.127.116.11");
// then instantiate it with the reflection activator
IFooBarThing thing = Activator.CreateInstance(type) as IFooBarThing;
Aparently, things just got moved around. The functionality is still there.