Remoting, System.Reflection.TargetInvocationException Remoting, System.Reflection.TargetInvocationException
Old forum URL: forums.lhotka.net/forums/t/3905.aspx
SimonW posted on Friday, November 16, 2007
I'm new to CSLA, and havebeen struggling with trying to set up Remoting. I've got a response from the server-side so am trying to get my BOs mobile. It looks like I have a serialization issue, but I'm really struggling to see how to move forward.
Could someone give me some pointers about what I should be looking for and to move forward on this. I'm on CSLA 3.01.
Thanks
Simon
Sorry about this but I'm going to have to paste in a stack trace.
Server stack trace:
at System.RuntimeMethodHandle._SerializationInvoke(Object target,
SignatureStruct& declaringTypeSig, SerializationInfo info,
StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target,
SignatureStruct declaringTypeSig, SerializationInfo info,
StreamingContext context)
at
System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object
target, SerializationInfo info, StreamingContext context)
at
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object
obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String
objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel
securityLevel)
at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders,
Stream requestStream, IMessage& responseMsg, ITransportHeaders&
responseHeaders, Stream& responseStream)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Csla.Server.IDataPortalServer.Fetch(Type objectType, Object criteria, DataPortalContext context)
at Csla.DataPortalClient.RemotingProxy.Fetch(Type objectType, Object
criteria, DataPortalContext context) in C:\Documents and Settings\Simon
Woods\My Documents\Visual Studio
2005\Projects\cslavb\cslavb\Csla\DataPortal\Client\RemotingProxy.vb:line
113
at Csla.DataPortal.Fetch(Type objectType, Object criteria) in
C:\Documents and Settings\Simon Woods\My Documents\Visual Studio
2005\Projects\cslavb\cslavb\Csla\DataPortal\Client\DataPortal.vb:line
197
at Csla.DataPortal.Fetch[T](Object criteria) in C:\Documents and
Settings\Simon Woods\My Documents\Visual Studio
2005\Projects\cslavb\cslavb\Csla\DataPortal\Client\DataPortal.vb:line
148
at InfoFlex.Definitions.DefinitionBase`1.GetDefinition(String p_Key,
Boolean p_Reload) in C:\Documents and Settings\Simon Woods\My
Documents\Visual Studio
2005\Projects\InfoFlex\InfoFlex.Definitions\DefinitionBase.vb:line 297
at InfoFlex.Definitions.DefinitionBase`1.GetDefinition(String p_Key)
in C:\Documents and Settings\Simon Woods\My Documents\Visual Studio
2005\Projects\InfoFlex\InfoFlex.Definitions\DefinitionBase.vb:line 283
at IfxTest.Form1.Button1_Click(Object sender, EventArgs e) in
C:\Documents and Settings\Simon Woods\My Documents\Visual Studio
2005\Projects\InfoFlex\IfxTest\Form1.vb:line 5
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at IfxTest.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()SimonW replied on Sunday, November 18, 2007
Thanks but I've managed to sort this. I'm pretty new to the CSLA and was struggling to set everything up properly. I hadn't understood about authentication and my DB connection string wasn't correct.
I think one of the problems when you're new to this is that the error messages don't give any pointers to what the problem might be. Further, because my knowledge is pretty limited , it is difficult to know how to break the problem down.
JoeFallon1 replied on Monday, November 19, 2007
For newbies, I always recommend setting up everything to run locally at first.
Once that works things like connection string errors won;t be an issue - since you will have fixed them already. Debug remoting issues becomes a search for a configuration problem, since your code works locally!
Joe
Copyright (c) Marimer LLC