xamarin.ios - Microsoft.Threading.Tasks.Extensions in Xamarin Mono projects -


i have built nuget package simple.odata.client support xamarin android , ios. library uses microsoft.bcl.async. tests using android , ios simulator went ok, when install new nuget package project, fails compile droid/touch projects following message:

c:\program files (x86)\msbuild\xamarin\android\xamarin.android.common.targets(720,2): error : exception while loading assemblies: system.io.filenotfoundexception: not load assembly 'microsoft.threading.tasks.extensions, version=1.0.12.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'. perhaps doesn't exist in mono android profile? c:\program files (x86)\msbuild\xamarin\android\xamarin.android.common.targets(720,2): error : file name: 'microsoft.threading.tasks.extensions.dll' 

of course there no microsoft.bcl.async pack (yet) mono platforms, on other hand since library tests pass on these platforms, guess more of challenge make visual studio happy rather code modification.

has managed use on mono pcls dependent on microsoft.bcl.async?

generally, if code in package depends on nuget package, need declare package dependency installing package 1 depend on too. should take care of issues this.

however, in case lot more complicated. since microsoft.bcl.async doesn't support mono platforms, can't declare package dependency (or if did fail install). unfortunately license microsoft.bcl.async restricts "windows platforms". i'm not lawyer think means shouldn't distribute microsoft.threading.tasks.extensions.dll part of package. finally, there's no official pcl support mono platforms yet, if come solution works may change when official pcl support comes out.

if want attempt getting work, need create own dlls same names in microsoft.bcl , microsoft.bcl.async use on mono platforms. in assemblies, put type forwards types mono implements (which should types in system.* dlls), , create implementation of own other ones (the asyncbridge source code useful this). did 1 of build 2012 pcl demos. code here. asyncfacades , asyncbridge relevant projects.


Comments