[Mono-list] Compile vs. run

Gonzalo Paniagua Javier gonzalo at ximian.com
Fri Feb 3 18:43:29 EST 2006


On Thu, 2006-02-02 at 19:24 -0500, Chad Robinson wrote:
> When I do this:
> 
> s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
> s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
> 
> this happens:
> 
> ** (NetDump.exe:25323): WARNING **: Missing member SetSocketOption in type 
> Socket, assembly /usr/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll
> 
> Unhandled Exception: System.MissingMethodException: Method not found: 
> 'System.Net.Sockets.Socket.SetSocketOption'.
> 
[...]
> Both the DLL and EXE are compiled in Windows. When I run it, I get the above. 
> When I compile in Linux using the same code, it works fine.
> 
> Is this by design, or a known issue, or am I simply doing something wrong? If 
> the former, no problem - I'll just do a separate build on Linux for 
> executables being sent to Linux systems. But if it's ME, I'd obviously love to 
> know so I can fix it. =)

The problem is that we didn't have the new SetSocketOption overload that
takes a boolean as the option value in Socket.cs. When you compiled
using mono, the overload that takes an object was used instead.

I have just added it to svn HEAD.

-Gonzalo




More information about the Mono-list mailing list