0

I've got a PCL which includes System.Data.Linq(.Mappings) via the dll itself. This works with iOS, Windows and MacOS, but it does not with Android.

Temp:

I will post the error message as soon as I am back at work, but I remember it was something like "Could not load file or assembly System.Data.Linq". It was not found

I know this namespace is not supported inside a PCL, but it is strange that it works (and yes, I made multiple projects with this) in every project type except Xamarin:Android.

Is there anything I could try like implementing the code myself, embed assemblies in native code, or something else?

Thanks for your help

DirtyNative
  • 2,553
  • 2
  • 33
  • 58

1 Answers1

0

Is there anything I could try like implementing the code myself, embed assemblies in native code, or something else?

I think no. As you already known, System.Data.Linq is unavailable in PCLs, and there is no lambda expressions in Android (or Java) yet. Also we need to respect the design of PCL, it is used to write and build managed assemblies that work on more than one .NET Framework platform. So if the method/dll or something else is not supported in the projects which uses this PCL, then this method/dll should not be placed in PCL.

Also, Xamarin.Forms is designed as a cross-platform UI toolkit that allows developers to easily create native user interface layouts that can be shared across Android, iOS, and Windows Phone. It is mainly target sharing UI. Of course you can also specify the platform when calling method/dll in its PCL, for example like this:

#if __MOBILE__
// Xamarin iOS or Android-specific code
#endif

For more info about specifying platform, you can refer to Dealing with Multiple Platforms.

Grace Feng
  • 16,564
  • 2
  • 22
  • 45