Hi there.
I have a strange problem here. I have a working client/server pair that
communicates through a TCP channel, the "well known object" is known to
the client through it's interface and instanced using Activator.
There are a couple of assemblies involved, but in the end it all comes
down to Frontend, Common, Core and Broker. The interface is defined in
Common, the server's business logic in Core and the Server itself is set
up by Broker.
Neither Frontend nor Common reference Core, but all assemblies reference
Common.
I can call some of the server's functions successful, but as soon as I
call a specific function, as soon as the server returns the results to
the client a TargetInvocationException with an FileNotFoundException as
it's inner exception is thrown. The inner exception's details tell that
the client tries to search for the Core assembly. Which is odd, because
the result type is defined in Common which, as I said, does not know
about Core.
We are compiling for the 2.0 framework under VS08 and are using the
ExtensionAttribute "hack" to get extension method support. There are
some extension methods defined on the return type in the Core assembly
but I'm not sure how this could create a problem like this.
Does anyone has an idea what's the problem there?
Regards + Greets from Berlin,
Markus
Here's the exception info that Visual Studio gave me.
System.Reflection.TargetInvocationException was unhandled by user code
Message="Ein Aufrufziel hat einen Ausnahmefehler verursacht."
Source="mscorlib"
StackTrace:
Server stack trace:
bei System.RuntimeMethodHandle._SerializationInvoke(Object
target, SignatureStruct& declaringTypeSig, SerializationInfo info,
StreamingContext context)
bei
System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object
target, SerializationInfo info, StreamingContext context)
bei
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object
obj, SerializationInfo info, StreamingContext context)
bei
System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
holder)
bei System.Runtime.Serialization.ObjectManager.DoFixups()
bei
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
bei
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage
msg)
Exception rethrown at [0]:
bei
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
bei
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
bei
com.derixx.dll.common.interfaces.IRemoteObject.GetDerivatives(ClientParams
cp, DerivativeSearch searchParams)
bei
com.derixx.clientside.frontend.comm.RemoteCaller.GetDerivatives(DerivativeSearch
sp) in
E:\derixx\trunk\src\derixx\com\derixx\clientside\Frontend\comm\RemoteCaller.cs:Zeile
782.
bei
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
bei
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage
msg, IMessageSink replySink)
InnerException: System.IO.FileNotFoundException
Message="Die Datei oder Assembly Core, Version=1.0.3048.2184,
Culture=neutral, PublicKeyToken=null oder eine Abhängigkeit davon wurde
nicht gefunden. Das System kann die angegebene Datei nicht finden."
Source="mscorlib"
FileName="Core, Version=1.0.3048.2184, Culture=neutral,
PublicKeyToken=null"
FusionLog="=== Zustandsinformationen vor Bindung ===\r\nLOG:
Benutzer = acquitaine\\sunside\r\nLOG: DisplayName = Core,
Version=1.0.3048.2184, Culture=neutral, PublicKeyToken=null\n
(Fully-specified)\r\nLOG: Appbase =
file:///E:/derixx/trunk/src/derixx/bin/Client/\r\nLOG: Ursprünglicher
PrivatePath = NULL\r\nAufruf von Assembly : (Unknown).\r\n===\r\nLOG:
Diese Bindung startet im default-Load-Kontext.\r\nLOG: Es wurde keine
Anwendungskonfigurationsdatei gefunden.\r\nLOG: Die
Computerkonfigurationsdatei von
C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config
wird verwendet.\r\nLOG: Die Richtlinie wird derzeit nicht auf den
Verweis angewendet (private, benutzerdefinierte, teilweise oder
pfadbasierte Assemblybindung)\r\nLOG: Download von neuem URL
file:///E:/derixx/trunk/src/derixx/bin/Client/Core.DLL.\r\nLOG: Download
von neuem URL
file:///E:/derixx/trunk/src/derixx/bin/Client/Core/Core.DLL.\r\nLOG:
Download von neuem URL
file:///E:/derixx/trunk/src/derixx/bin/Client/Core.EXE.\r\nLOG: Download
von neuem URL
file:///E:/derixx/trunk/src/derixx/bin/Client/Core/Core.EXE.\r\n"
StackTrace:
bei System.Reflection.Assembly._nLoad(AssemblyName
fileName, String codeBase, Evidence assemblySecurity, Assembly
locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound,
Boolean forIntrospection)
bei System.Reflection.Assembly.InternalLoad(AssemblyName
assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark,
Boolean forIntrospection)
bei System.Reflection.Assembly.InternalLoad(String
assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark,
Boolean forIntrospection)
bei System.Reflection.Assembly.Load(String assemblyString)
bei
System.Reflection.MemberInfoSerializationHolder..ctor(SerializationInfo
info, StreamingContext context)
InnerException:
Oh no. I was puzzling over this for four whole days and minutes after I
asked for help I figured it out.
The return value, which was marked as [Serializable], contained a
delegate field which obviously had callbacks from the Core assembly
attached. I marked this field as [NonSerializable] and everything works
fine now.
Maybe this lesson is of some help for anyone else.
Markus
Markus Mayer schrieb:
> Hi there.
>
[quoted text clipped - 24 lines]
> Regards + Greets from Berlin,
> Markus