Hello everyone,
I am currently writing an ASP.NET application that uses unmanaged COM+
components that are supposed to be installed in a different server. I am
using the following code to connect via DCOM to these components and it does
not work, it raises "Specified cast is not valid" exception when line 3
executes. This happens for all components. Exactly the same code works if
connecting locally (i.e localhost is used in line 1) and it always works
from a Windows Forms application even connecting to another server. I figure
it could be some setting that is different but so far I have not found
anything on that. Any help would be really appreciated.
Here is the code:
Type type = Type.GetTypeFromProgID("CorporaServer.CorporaAppServer",
"RemoteServer"); // this line 1
Object objTest = Activator.CreateInstance(type);
CorporaAppServer CorporaServerObj = (CorporaAppServer)objTest; // this is
line 3
if (CorporaServerObj.AuthenticationRequired())
return "Authentication required";
else
return "Authentication not required";
Thanks in advance,
Jose R. Rodr?guez
Jos? Ram?n Rodr?guez - 12 Jan 2004 19:11 GMT
I was able to solve this problem by using impersonation in the ASP.NET
application. This worked very well in a Windows Forms application.
> Hello everyone,
>
[quoted text clipped - 23 lines]
>
> Jose R. Rodr?guez