InvalidCastException from ComObject to IRemoteDispatch

G

Guest

I had built a COM+ object in VB.Net using EnterpriseServices. The COM+
object runs fine and interacts with the ASP.Net pages fine. I do get a weird
error about once a day:


System.InvalidCastException: Unable to cast object of type
'System.__ComObject' to type 'System.EnterpriseServices.IRemoteDispatch'.
at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage
reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at BethelWeb_BO.clsBO.GetUserId(String email, String localIndexPath,
String page)
at ASP.forgotpassword_aspx.btnEMailPassword_Click(Object sender,
EventArgs e) in D:\Bethel Woods Live\ForgotPassword.aspx:line 19


We have 2 load balanced web servers both running Windows Server 2003. We
have the COM+ component located on another machine with Windows Server 2003
(the component is installed as a remote component on both the web servers).
We are using Visual Studio 2005 for both the ASP.Net pages (writen in VB.Net)
and the COM+ component (also VB.Net).

This isn't the only place we get the error. The error is always the same,
but the place where the error occurs changes. The error always occurs in the
first method call into the COM+ component though. I am unable to find an
exact scenario to be able to reproduce the problem (I was able to reproduce
it once, but it must have been a fluke because I can't do it again).

Here is the partial method that the above error is coming from (the last
line is line 19 where the error occurs.


Protected Sub btnEMailPassword_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim bo As clsBO = Nothing
Dim userID As Integer = 0

Try
bo = New clsBO

If Page.IsValid Then
userID = bo.GetUserId(txtEMail.Text,
Server.MapPath("index.html"), Request.Path)
...


Any help would be appreciated.


Thanks,
Devin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top