By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,272 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,272 IT Pros & Developers. It's quick & easy.

"Unable to cast object of type" error

P: 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
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.