pgstath / Sharp.Xmpp

Sharp.Xmpp is looking for a maintainer! Unfortunatelly I do not have currently the time needed to maintain the library. Luckily a small but vibrant community has evolved around Sharp.Xmpp. If you would like to be the project's maintainer please sent an email to pgstath@gmail.com. This should include issues, tickets and commits that you have done for Sharp.Xmpp or other similar project. Sharp.Xmpp is a multiplatform, Windows and Android, .NET XMPP client assembly.Sharp.Xmpp supports IM functionality & a variety of XMPP extensions, is simple and is extensively tested against Android Xamarin. It is a fork of the currently frozen excellent S22.Xmpp project. Sharp.Xmpp will be at the FOSSDEM 2016 Real time DevRoom!
Other
84 stars 51 forks source link

TargetInvocationException on XmppIM Constructor #43

Closed romuloprandini closed 3 years ago

romuloprandini commented 7 years ago

Hi,

I'm having a TargetInvocationException when instantiate the XmppClient. Can someone help?

Here the code I created: var client = new XmppClient("host.com"); client.Message += delegate(object sender, MessageEventArgs args) { OnMessage?.Invoke(this, new XamarinForms.XMPP.MessageEventArgs { Message = args.Message.Body, TimeStamp = args.Message.Timestamp, UserId = client.Jid.Node, }); }; client.Authenticate("myuser", "password");

Error occurs in this line of the XmppIM constructor: core = new XmppCore(hostname, port, tls, validate);

And thats the stack trace: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00016] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:667 at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000ca] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:179 at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0001a] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:153 at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0002a] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/rttype.cs:5638 at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00040] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/activator.cs:201 at System.Activator.CreateInstance (System.Type type) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/activator.cs:134 at Xamarin.Forms.DependencyService.Get[T] (Xamarin.Forms.DependencyFetchTarget fetchTarget) [0x0006c] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\DependencyService.cs:36 at GuideUp.XamarinForms.App.<SubscribeToReceiveChatMessage>b__14_0 (FormsToolkit.IMessagingService service, GuideUp.Services.Models.UserVO user) [0x00015] in C:\Users\romul\Documents\Visual Studio 2015\Projects\GuideUp\GuideUp.XamarinForms\GuideUp.XamarinForms\App.xaml.cs:132 at Xamarin.Forms.MessagingCenter+<>c__DisplayClass3_0"2[TSender,TArgs].<Subscribe>b__0 (System.Object sender, System.Object args) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\MessagingCenter.cs:37 at Xamarin.Forms.MessagingCenter.InnerSend (System.String message, System.Type senderType, System.Type argType, System.Object sender, System.Object args) [0x00069] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\MessagingCenter.cs:95 at Xamarin.Forms.MessagingCenter.Send[TSender,TArgs] (TSender sender, System.String message, TArgs args) [0x00013] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\MessagingCenter.cs:16 at FormsToolkit.MessagingService.SendMessage[TArgs] (System.String message, TArgs args) [0x00000] in <a13e555e7ad24aad8f7ee100294829f7>:0 at GuideUp.XamarinForms.ViewModel.LoginListViewModel+<>c+<<SubscribleToLoginMessages>b__3_0>d.MoveNext () [0x000ce] in C:\Users\romul\Documents\Visual Studio 2015\Projects\GuideUp\GuideUp.XamarinForms\GuideUp.XamarinForms\ViewModel\User\LoginListViewModel.cs:68

My Project has only a portable and an android projects.

Thanks

romuloprandini commented 3 years ago

Closing this issue as no one replied and I am not using the package anymore 😢