Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / January 2004

Tip: Looking for answers? Try searching our database.

Connecting to remote COM+ object from .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jos? Ram?n Rodr?guez - 29 Dec 2003 21:59 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.