Connecting Tech Pros Worldwide Help | Site Map

"Unable to cast object of type" error

  #1  
Old July 21st, 2005, 12:09 PM
Pankaj Jain
Guest
 
Posts: n/a
Hi All,

I have a class A which is derived from ServicesComponent to participate in automatic transaction with falg Transaction.Required. Class A is exposed to client through remoting on Http channal hosting into IIS.
There is a class B which is also available through remoting hosted on IIS on the same URI. B creates new of A inside a function. It succeed and able to create instance of A inside B first time. But it failes in 2nd attempt when we retry to create the instance of A inside B. But if we restart the IIS then we are able to create instance of A first time.

Instance of Class B is created from a script written inside the MS exchange server.

Please help us to find the reason behind it.

exact exception which we had traced is:
"An error occured: Unable to cast object of type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService to type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService.
Source: mscorlib
Message: Unable to cast object of type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService to type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService.
StackTrace: at System.Runtime.InteropServices.Marshal.GetTypedObj ectForIUnknown(IntPtr

pUnk, Type t)
at System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Type

serverType)
at

System.Runtime.Remoting.Activation.ActivationServi ces.CreateInstanceWithLinkDemand(ProxyAttri

bute pa, Type serverType)
at System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type

serverType, Object[] props)
at Hclt.HydraPlatform.Dts.OperationTI.DTSExposedOpera tions.SendUserIntervention(String

inSender, String sProjectCode, Int32 nDefectId, String sPhase, String sModuleId, Int32

iProcessId, Int32 nInterveneType, String sOwner, String sRole)"


Any help would be incredible for us becasue it making our application inconsistant behaviour.

regads,
Pankaj Jain,
Project Leader,
HCL Technologies India


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Unable to cast object of type 'System.String' to type 'System.String[]'." archu007 answers 4 October 5th, 2007 05:35 PM
Error Rendering Control: unable to cast object of type "System.Web.UI.Page" epatrick@yahoo.com answers 1 April 12th, 2007 04:05 PM
Error "Unable to cast object of type"-- but types are the same! JackBlack answers 4 September 22nd, 2006 05:55 AM
"Unable to cast object of type" error Pankaj Jain answers 0 November 22nd, 2005 07:01 AM