linker - Trouble with xamarin.ios/monotouch , mvvmcross and linking -


i have irritating issue, if use link sdk assemblies in xamarin studio exception, if use dont link exception not happening. have located issue part of third party dll using(api video streaming service). believe linker stripping of methods used dll. possible skip link of libraries , possible see stacktrace.

    2013-05-08 14:40:54.688 appsfabrikkentouch[5662:907] mvx: diagnostic:  18,23 exception masked nullreferenceexception: object reference not set instance of object       @ system.delegate.combine (system.delegate a, system.delegate b) [0x00018] in /developer/monotouch/source/mono/mcs/class/corlib/system/delegate.cs:473    @ cirrious.mvvmcross.viewmodels.mvxnotifypropertychanged.add_propertychanged (system.componentmodel.propertychangedeventhandler value) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.bindings.source.mvxbasepropertyinfosourcebinding..ctor (system.object source, system.string propertyname) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.bindings.source.mvxpropertyinfosourcebinding..ctor (system.object source, system.string propertyname) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.bindings.source.construction.mvxsourcebindingfactory.createbinding (system.object source, ienumerable`1 childpropertynames) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.bindings.source.construction.mvxsourcebindingfactory.createbinding (system.object source, system.string combinedpropertyname) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.binders.mvxfullbinding.createsourcebinding (system.object source) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.binders.mvxfullbinding..ctor (cirrious.mvvmcross.binding.interfaces.mvxbindingrequest bindingrequest) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.binders.mvxfromtextbinder.bindsingle (cirrious.mvvmcross.binding.interfaces.mvxbindingrequest bindingrequest) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.binders.mvxfromtextbinder+<>c__displayclass1.<bind>b__0 (cirrious.mvvmcross.binding.interfaces.mvxbindingdescription description) [0x00000] in <filename unknown>:0    @ system.linq.enumerable+<createselectiterator>c__iterator1d`2[cirrious.mvvmcross.binding.interfaces.mvxbindingdescription,cirrious.mvvmcross.binding.interfaces.imvxupdateablebinding].movenext () [0x00000] in <filename unknown>:0    @ system.collections.generic.list`1[cirrious.mvvmcross.binding.interfaces.imvxupdateablebinding].addenumerable (ienumerable`1 enumerable) [0x00000] in <filename unknown>:0    @ system.collections.generic.list`1[cirrious.mvvmcross.binding.interfaces.imvxupdateablebinding].addrange (ienumerable`1 collection) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.touch.extensionmethods.mvxbindingtouchextensions.addbindings (imvxbindingtouchview view, ienumerable`1 bindings) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.touch.extensionmethods.mvxbindingtouchextensions.addbindings (imvxbindingtouchview view, system.object source, system.object target, system.string bindingtext) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.touch.extensionmethods.mvxbindingtouchextensions.addbindings (imvxbindingtouchview view, system.object source, idictionary`2 bindingmap) [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.binding.touch.extensionmethods.mvxbindingtouchextensions.addbindings (imvxbindingtouchview view, idictionary`2 bindingmap) [0x00000] in <filename unknown>:0    @ cmsapp.touch.tabtextview.viewdidload () [0x00074] in /volumes/2end hdd/dropbox/appprojects/appsfabrikken/cmsapp.touch/views/umbracoviews/tabtextview.cs:45    @ monotouch.uikit.uinavigationcontroller.pushviewcontroller (monotouch.uikit.uiviewcontroller viewcontroller, boolean animated) [0x00019] in /developer/monotouch/source/monotouch/src/uikit/uinavigationcontroller.g.cs:178    @ cmsapp.touch.appphonepresenter.show (imvxtouchview view) [0x0007b] in /volumes/2end hdd/dropbox/appprojects/appsfabrikken/cmsapp.touch/appphonepresenter.cs:62    @ cirrious.mvvmcross.touch.views.presenters.mvxtouchviewpresenter.show (cirrious.mvvmcross.views.mvxshowviewmodelrequest request) [0x00000] in <filename unknown>:0    @ cmsapp.touch.appphonepresenter.show (cirrious.mvvmcross.views.mvxshowviewmodelrequest request) [0x00000] in /volumes/2end hdd/dropbox/appprojects/appsfabrikken/cmsapp.touch/appphonepresenter.cs:37    @ cirrious.mvvmcross.touch.views.mvxtouchviewdispatcher+<>c__displayclass1.<requestnavigate>b__0 () [0x00000] in <filename unknown>:0    @ cirrious.mvvmcross.touch.views.mvxtouchuithreaddispatcher+<>c__displayclass1.<invokeorbegininvoke>b__0 () [0x00000] in <filename unknown>:0  

any appreciated.

update: suggested stuart (thanks stuart) have added linkerpleaseinclude file following: still exception.

class linkerincludeplease     {         private void delegatecombine(delegate a, delegate b)         {             var d = delegate.combine(a,b);         }          private void delegatecombine(params delegate[] delegates)         {             var d = delegate.combine(delegates);         }          private void delegatecombine()         {             var d = delegate.combine();         }      } 

my thought had related stacktrace

exception masked nullreferenceexception: object reference not set instance of object           @ system.delegate.combine (system.delegate a, system.delegate b) [0x00018]  

but seems not trick - pointers find stripped out?

is possible skip link of libraries

yes. can isolate issue (and 100% sure of origin) 3rd party using --linkskip=assembly option (in additional mtouch arguments in project's options). can used release workaround (but better find more precise solution full benefits linker).

e.g. --linkskip=mscorlib skip mscorlib.dll (i.e. no file extension)

is possible see stacktrace ?

not quite. issue not system.delegate.combine. since it's named in stack trace know it's not removed linker.

otoh 1 of it's argument (a delegate) removed. can (most likely) happen if created using reflection (since linker use static analysis). can use stack trace see (type) should have been used in combine call , work backward there, e.g. find how created.

once find you'll want linker keep it. can adding extra, unneeded code (like @stuart suggested). own suggestions to:

  • use [preserve] attributes when have source code;

  • use xml file (and --xml=file) when not have source code;


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -