Home Forums Support System.TypeInitializationException happens on iOS device, not in simulator Reply To: System.TypeInitializationException happens on iOS device, not in simulator

#4221
Anonymous
Inactive

Hi Marc,
I’m not sure that I’m doing that, but would that explain why it only doesn’t work on a physical iOS device?

This is the server code I’ve got:

private void StartServer()
{
NetworkComms.AppendGlobalIncomingPacketHandler<Message> ("Message", MessageHandler);
Connection.StartListening (ConnectionType.TCP, new IPEndPoint (IPAddress.Any, 0));
}

The Message class is very similar to the ChatMessage class in the example. I noticed in the ChatWindow class in the example that it has this line:
ChatApplication.Serializer = DPSManager.GetDataSerializer<NetworkCommsDotNet.DPSBase.ProtobufSerializer>();

With a variable Serializer in ChatAppBase:
public DataSerializer Serializer { get; set; }

But if I try and do the following within my ViewController class (where the rest of the code is), I get an error:
public DataSerializer Serializer = DPSManager.GetDataSerializer<NetworkCommsDotNet.DPSBase.ProtobufSerializer>();

Error, even though I’ve got NetworkCommsDotNet in my references:
The type 'NetworkCommsDotNet.DPSBase.DataSerializer' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'NetworkCommsDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Sorry if I’m missing something basic with this, but I’m not really sure what to do.

  • This reply was modified 9 years, 1 month ago by .
  • This reply was modified 9 years, 1 month ago by .