1

I have three versions of the same application: iPhone, Mono Console, Windows Console application. All of them contain exactly the same code (via MonoTouch C#). On the Mono(Touch) framework I get the following exception from the Assembly Browser: (Windows works perfectly)

System.NullReferenceException: Object reference not set to an instance of an object
  at System.Net.Sockets.Socket+SocketAsyncResult.Complete () [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:240
  at System.Net.Sockets.Socket+SocketAsyncResult.Complete (System.Exception e) [0x00007] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:304
  at System.Net.Sockets.Socket+Worker.Accept () [0x00077] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:510
  at System.Net.Sockets.Socket+Worker.DispatcherCB (System.Net.Sockets.SocketAsyncResult sar) [0x0009e] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:432

Are there any known problems using System.Net.Sockets on MonoTouch? Does anyone know what this exception means (besides the obvious NullReference)? I'm very new to this area. Hopefully someone can point me in the right direction.

skolima
  • 31,963
  • 27
  • 115
  • 151
r712m
  • 299
  • 3
  • 7

2 Answers2

2

This isn't a problem with MonoTouch, but with MonoDevelop.

I suggest filing a bug here: http://bugzilla.xamarin.com so the appropriate people can look at it.

This bug will not prevent you from using MonoTouch (just don't use the Assembly Browser for the assemblies that causes this, you can view the source code directly here instead: https://github.com/mono/mono/tree/mono-2-10).

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86
  • Thanks for the answer. But I'm sorry, I'm very new, I don't understand. How will it not prevent me from using MonoTouch if I just dont use the Assembly Browser? Being able to make the connection is a great deal for my app. What good is the mono source code in my situation? – r712m Jun 06 '12 at 13:02
  • You said you got the exception when using the Assembly Browser, thus you will not see the exception if you don't use the Assembly Browser. You do not have to use the Assembly Browser to use MonoTouch, the Assembly Browser is just used to view the contents of assemblies, and viewing the source code is an alternative to that. – Rolf Bjarne Kvinge Jun 06 '12 at 14:33
  • Ah, thanks for the heads up, learned something :) But the app still wont work right. – r712m Jun 06 '12 at 15:19
  • I suggest you file a bug as I explained, and attach your project. That way other people can look at your project and find the problems. – Rolf Bjarne Kvinge Jun 06 '12 at 21:46
0

Bug that looks similar to your problem is registered in Mono's bugzilla at https://bugzilla.xamarin.com/show_bug.cgi?id=2965 . At the moment of writing there was a proposed fix for the Mono framework, but the bug still was not marked as closed or resolved.

alex
  • 12,464
  • 3
  • 46
  • 67