Bug 11893 - WCF call to ClientruntimeChannel ctor throws null reference exception on device
Summary: WCF call to ClientruntimeChannel ctor throws null reference exception on device
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
: 12356 ()
Depends on:
Reported: 2013-04-23 00:21 UTC by Felix Collins
Modified: 2013-05-27 09:45 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Felix Collins 2013-04-23 00:21:45 UTC
WCF call to ClientruntimeChannel ctor throws null reference exception on device only (works fine in simulator). This does not happen in
It does happen in

example stack trace from my app...

Apr 23 14:26:26 Mokey TouchContainer[1015] <Warning>: [MobileBullet] Exception: MobileBullet.MBWSConnection : Web service call 'InterfaceVersionRequest' failed (←17|9)
System.NullReferenceException: Object reference not set to an instance of an object
at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Dispatcher.ClientRuntime runtime, System.ServiceModel.Description.ContractDescription contract, TimeSpan openTimeout, TimeSpan closeTimeout, IChannel contextChannel, IChannelFactory factory, System.ServiceModel.Channels.MessageVersion messageVersion, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) [0x0012f] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:121
at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.ChannelFactory channelFactory, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) [0x00027] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:90
at System.ServiceModel.ClientBase`1+ChannelBase`1[MagicBullet.Service.IMobileBullet,MagicBullet.Service.IMobileBullet].get_Inner () [0x00000] in <filename unknown>:0
at System.ServiceModel.ClientBase`1+ChannelBase`1[MagicBullet.Service.IMobileBullet,MagicBullet.Service.IMobileBullet].System.ServiceModel.ICommunicationObject.Open () [0x00000] in <filename unknown>:0
at System.ServiceModel.ClientBase`1[MagicBullet.Service.IMobileBullet].Open () [0x00000] in <filename unknown>:0
at MobileBullet.MBWSConnection.ClientFactory (System.String webServiceAddress) [0x000b4] in /Users/felix/MagicBullet/src/MagicBullet/MobileBullet/XPlatform/WebService/MBWSConnection.cs:73
at MobileBullet.MBWSConnection.GetClient (System.String webServiceAddress) [0x0001e] in /Users/felix/MagicBullet/src/MagicBullet/MobileBullet/XPlatform/WebService/MBWSConnection.cs:85
at MobileBullet.MBWSConnection+<CallAsync>c__AnonStorey21`2[MobileBullet.InterfaceVersionRequest,MobileBullet.InterfaceVersionRequestResponse].<>m__E (System.Object x) [0x00000] in <filename unknown>:0
Apr 23 14:26:26 Mokey TouchContainer[1015] <Warning>: [MobileBullet] Warning: MobileBullet.DomainObjectService : Updating version numbers did not complete successfully due to an exception during the web service call
Exception: NullReferenceException:Object reference not set to an instance of an object
Comment 1 Felix Collins 2013-04-23 18:02:55 UTC
I tried installing a version from https://store.xamarin.com/account/my/subscription/downloads

This one works.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2013-04-25 18:02:01 UTC
Can you provide a test case we can use to reproduce this?
Comment 8 Rolf Bjarne Kvinge [MSFT] 2013-04-29 10:28:42 UTC
This looks linker-related. If I disable the managed linker the app works fine on device.
Comment 9 Felix Collins 2013-04-29 16:51:22 UTC
Thanks for that! I should have thought to try that. I'll keep it in mind if I have to work around. At the moment I'm happy running the older release and waiting for a fix.
Comment 10 Sebastien Pouliot 2013-04-30 13:47:37 UTC
System.ServiceModel.Channels.HttpChannelFactory`1[System.ServiceModel.Channels.IRequestChannel].CreateChannel not available and there's nothing (now or before) that protected it.

I think this comes from some linker improvements that removes unused interface members (IChannelFactory in this case).
Comment 11 Sebastien Pouliot 2013-04-30 14:08:34 UTC
Fixed in b4fac5e9299462d8030a62c9177fb5bb17b0e6e7 (master-3.0)

Thanks for the test case.
Comment 12 Sebastien Pouliot 2013-05-27 09:45:01 UTC
*** Bug 12356 has been marked as a duplicate of this bug. ***