TReKiE / msnp-sharp

Automatically exported from code.google.com/p/msnp-sharp
0 stars 0 forks source link

System.NotImplementedException on latest Mono/Linux #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a software which uses MSNPSharp. It works on Winddows but doesn't on
Mono/Linux. I had 1.9, so I tried to update it to the latest SVN version
but it still doesn't work.
I took your latest MSNPSharp version (2.05).

Mono version is :
# mono --version
Mono JIT compiler version 2.1 (/trunk/mono r111973)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none

Thank you for your work, this library is great !

The exception stack trace is :

Unhandled Exception: System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.NotImplementedException: The requested feature is not implemented.
  at System.Net.ServicePointManager.set_ServerCertificateValidationCallback
(System.Net.Security.RemoteCertificateValidationCallback value) [0x00000]
  at MSNPSharp.ContactService..ctor () [0x00000]
  at MSNPSharp.ContactService..ctor (MSNPSharp.NSMessageHandler nsHandler)
[0x00000]
  at MSNPSharp.NSMessageHandler..ctor () [0x00000]
  at (wrapper managed-to-native)
System.Reflection.MonoCMethod:InternalInvoke
(object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000]
  --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000]
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000]
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters)
[0x00000]
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
[0x00000]
  at MSNPSharp.Core.Factory.CreateNameserverHandler () [0x00000]
  at MSNPSharp.Messenger..ctor () [0x00000]
  at InstantMsg.IMCMsn.Connect () [0x00000]
  at InstantMsg.IMCMsn..ctor () [0x00000]
  at InstantMsg.InstantMsgCore..ctor () [0x00000]
  at InstantMsg.Program.Main (System.String[] args) [0x00000]

Original issue reported on code.google.com by supe...@gmail.com on 30 Aug 2008 at 7:25

GoogleCodeExporter commented 9 years ago
I think it's still your code in : ConnectivitySettings.cs : 
                ServicePointManager.ServerCertificateValidationCallback = delegate
                {
                    return true;
                };

Because in the SVN mono file ( 
mcs/class/System/System.Net/ServicePointManager.cs:216 ) :
                public static RemoteCertificateValidationCallback
ServerCertificateValidationCallback
                {
                        get {
                                throw GetMustImplement ();
                        }
                        set {
                                throw GetMustImplement ();
                        }
                }

Original comment by supe...@gmail.com on 30 Aug 2008 at 8:05

GoogleCodeExporter commented 9 years ago
Won't it fall to the "catch" region?

Original comment by freezing...@gmail.com on 31 Aug 2008 at 5:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Well... I know it should. But it seems that it doesn't. 
Maybe it crashes because of me (I don't really know how). 
To make sure it's a standard Exception, I added : "
if (null != Type.GetType("Mono.Runtime"))
    throw new Exception("We must not execute what follows !");  
"

I will make some other tests...

Original comment by supe...@gmail.com on 31 Aug 2008 at 6:59

GoogleCodeExporter commented 9 years ago
What about change the code like this:
if(null == Type.GetType("Mono.RunTime"))
{
    ServicePointManager.ServerCertificateValidationCallback = delegate
    {
        return true;
    };
}else{
    ServicePointManager.CertificatePolicy = new MSNServiceCertificatePolicy();
}

If this works, I will submit the code.

Original comment by freezing...@gmail.com on 31 Aug 2008 at 12:36

GoogleCodeExporter commented 9 years ago
Sorry, for the late answer. I totally trashed my mono's SVN repository so I 
decided to take the etch-backport 
(for Debian) instead...

I have a pretty weird problem. I have exactly the same mono package on two 
servers. 

I use the Jabber-Net and the MSNPSharp libraries on the same exe. 

On server2, I can't manage to get anything from MSNPSharp but Jabber-Net works 
fine.
It shows :
 mono instantmsg.exe
03/09/2008 08:35:58 | instantmsg just started !
03/09/2008 08:35:58 | Starting Jabber...
03/09/2008 08:35:59 | Starting MSN...
.03/09/2008 08:36:01 | JABBER --> <stream:stream 
xmlns:stream="http://etherx.jabber.org/streams" 
id="7fb0075f" xmlns="jabber:client" to="gmail.com" version="1.0">

Jabber-Net is ok, but I don't have anything from MSNPSharp

On server1, MSNPSharp shows : 
mono instantmsg.exe
03/09/2008 08:38:49 | instantmsg just started !
03/09/2008 08:38:49 | Starting Jabber...
03/09/2008 08:38:49 | Starting MSN...

** (instantmsg.exe:30530): WARNING **: Missing method 
System.Net.Sockets.Socket::get_OSSupportsIPv6() in 
assembly /usr/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll, 
referenced in assembly 
/home/mabalise.com/dev-interne/exe/jabber-net.dll

** (instantmsg.exe:30530): WARNING **: Missing method 
System.Net.ServicePointManager::set_ServerCertificateValidationCallback(RemoteCe
rtificateValidationCallback) 
in assembly /usr/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll, 
referenced in assembly 
/home/mabalise.com/dev-interne/exe/MSNPSharp.dll
03/09/2008 08:38:49 | IMCMsn : ex : System.MissingMethodException: Method not 
found: 
'System.Net.ServicePointManager.set_ServerCertificateValidationCallback'.
  at MSNPSharp.Messenger..ctor () [0x00000]
  at InstantMsg.IMCMsn.Connect () [0x00000]
  at InstantMsg.IMCMsn..ctor () [0x00000]
  at InstantMsg.InstantMsgCore..ctor () [0x00000]
.

So here, MSN clearly won't work but Jabber-Net doesn't give any result at all 
on this server.

I'm just speaking about Jabber-Net hear to explain that I might be on a pretty 
weird environment (but I never 
had any problem before, and they are supposed to be the same).

Original comment by supe...@gmail.com on 3 Sep 2008 at 6:42

GoogleCodeExporter commented 9 years ago
Well... It seems that it was a problem with MY mono installation.

But, still, I managed to correct it and it doesn't seem to do anything. I will 
look
into it..

Original comment by supe...@gmail.com on 4 Sep 2008 at 4:20

GoogleCodeExporter commented 9 years ago
By the way, you can close this report error, it's totally useless. I will do an 
other
one later...

Original comment by supe...@gmail.com on 4 Sep 2008 at 4:34

GoogleCodeExporter commented 9 years ago
ok

Original comment by freezing...@gmail.com on 5 Sep 2008 at 2:56

GoogleCodeExporter commented 9 years ago

Original comment by hepha...@gmail.com on 23 Jan 2009 at 5:41