
Signature
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280
Phil,
The targetServer is the same computer executing the program. If it is set
to "localhost" or my computer name (Environment.MachineName) nothing turns up
in either the system or application eventlog.
If I set targetServer to ".", I get different results. First, the system
log contains an entry with:
Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10009
...
Computer: <my computer>
Description:
DCOM was unable to communicate with the computer . using any of the
configured protocols.
In this case, the exception is also different. It is:
System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is
unavailable.
Lastly, I've ran RegMon while I ran the problem with and without a value in
targetServer. Without a value, I see what would appear to be the problem.
When I execute GetTypeFromProgID with the targetServer null, I see it access
HKCR\CLSID\<clsid for my ProgID>\InProcServer32. When I have ".",
"localhost" or Evnironment.ComputerName in targetServer, it never accesses
HKCR\CLSID much less drill further to InProcServer32.
I guessing that I need to do something before GetTypeFromProgID to get it to
drill the registry further or that I need to do something afterwards but
before the call to Activator.CreateInstance. Nothing has jumped out of the
documentation at me though.
Thanks,
Mike
> I think that what you're effectively doing is DCOM, and there are a number
> of things that need setting up at the remote system. Is there anything in
[quoted text clipped - 61 lines]
> >> > Thanks,
> >> > Mike
Hagus - 22 Jan 2005 03:27 GMT
All,
I opened a case with Microsoft on this topic. One of the things I had not
specifically noted in my earlier posts is that the COM object was in-process.
When I called Activator.CreateInstance with the server parameter of
GetTypeFromProdID = null, the COM object's dll loaded into my program; my
program became its server.
Microsoft pointed out that when the type was created with a server name,
either my own computername or that of an actual remote computer, the COM
object needed a server program on the "remote" computer. So Microsoft's
solution to my problem was to have me add a DllSurrogate value under the key
HKCR\AppID\{<AppID_Guid>}. The DllSurrogate value needs to be specified in
the registry of the "remote" computer. In my case, I had to add the AppID
key as well as the DllSurrogate value, which I let the value defaut to blank.
Now when I run my client so that it calls GetTypeFromProgID with a non-null
server, I see the COM object load under dllhost when the client executes
Activator.CreateInstance.
Mike
> Phil,
>
[quoted text clipped - 98 lines]
> > >> > Thanks,
> > >> > Mike