Delta Engine
»
Support
»
Engine
»
Network messages, type resolution error.
Joined: 4/15/2014(UTC) Posts: 6 Location: Austin
|
When trying to send a custom class that is stored in a shared dll, the server receiving the message is giving an error that the type LoginMessage is not found. I have a client.exe, Common.dll, and server.exe and the Client sends a LoginMessage class to the server. LoginMessage is stored in the common.dll and referenced in both server and client. Any Ideas?
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Not sure without seeing more code. Sometimes this can happen because C# does not load your assembly until you first start using it (which is too late if you just wait for a message arriving). Try creating your message earlier, e.g. just in your Main() method like this: Code:
public static void Main()
{
new LoginMessage();
//rest
}
With more code I can give better tips, you might find a better place where to put this, or force loading all assemblies like we do in AppRunner, etc.
|
|
|
|
Joined: 4/15/2014(UTC) Posts: 6 Location: Austin
|
Code:{Server Error: System.TypeLoadException: Unable to find type: LoginMessage
at DeltaEngine.Core.BinaryDataExtensions.GetTypeFromFullName(String typeName)
at DeltaEngine.Core.BinaryDataExtensions.GetGenericTypeFromShortNameOrFullName(String typeName)
at DeltaEngine.Core.BinaryDataExtensions.GetTypeFromShortNameOrFullNameIfNotFound(String typeName)
at DeltaEngine.Core.BinaryDataExtensions.Create(BinaryReader reader)
at DeltaEngine.Networking.Tcp.TcpSocket.TryReceiveMessage(BinaryReader dataReader)
at DeltaEngine.Networking.Tcp.TcpSocket.OnObjectFinished(MessageData dataContainer)}
I tried making a new class of this at the beginning, but it still loads last in VS's debug output and I still get the error :/ Also, I looked into BinaryDataExtensions and looked at how it loads types, but the whole lot of calls are private, and the Apprunner file didn't really shed any light on how to manually load either... Sorry for the trouble, but I'm really interested in Delta and am just having a hard time figuring this one out lol.
|
|
|
|
Joined: 4/15/2014(UTC) Posts: 6 Location: Austin
|
Actually, the solution of making a new login message did work. I made the mistake of adding it to the client and not the server. XD Thanks for the help.
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Good, in v1.2 the BinaryData extensions are part of networking and a bit more clear. We will also look into loading all assemblies when client and server start, so this problem can be avoided. Thanks for your feedback.
|
|
|
|
Joined: 4/15/2014(UTC) Posts: 6 Location: Austin
|
Just a quick idea, you could also make it to where if it can't find the type when trying to deserialize it, it runs a routine to check for any new modules loaded since the static initializer and import those, and if all that fails, maybe throw an exception. As it stands, I had no idea that was the problem at first, I thought there was a problem with the data itself :P, that would make it a bit clearer what the actual issue is.
|
|
|
|
Delta Engine
»
Support
»
Engine
»
Network messages, type resolution error.
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.