Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline comwizz2  
#1 Posted : Thursday, April 24, 2014 11:52:08 PM(UTC)
comwizz2

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?

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Friday, April 25, 2014 12:26:13 AM(UTC)
Benjamin

Medals: Admin

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.
Offline comwizz2  
#3 Posted : Friday, April 25, 2014 3:22:12 PM(UTC)
comwizz2

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.
Offline comwizz2  
#4 Posted : Friday, April 25, 2014 3:53:08 PM(UTC)
comwizz2

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.
Offline Benjamin  
#5 Posted : Friday, April 25, 2014 4:53:28 PM(UTC)
Benjamin

Medals: Admin

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.
Offline comwizz2  
#6 Posted : Friday, April 25, 2014 9:33:37 PM(UTC)
comwizz2

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.
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
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.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.057 seconds.