3

I have imported a third party .net library into my Mono for Android project that uses the DataSetExtension library. When I try to compile I get the following errormessage:

Error 51 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'System.Data.DataSetExtensions.dll' at Monodroid.Tuner.MonoDroidResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly)

To resolve this issue I can add the .net System.Data.DataSetExtensions from the GAC, and set it to copy local. However, does anyone have a clue if it would work when I deploy to the device?

1 Answers1

3

That's generally not a good approach to take, since your application will crash if the DLL tries to access something not available in the Mono for Android profile. This answer has some more details about that. A list of the assemblies included in the profile is also available on Xamarin's site. In many cases, the Mono for Android profile is very similar to that of Silverlight, and since System.Data.DataSetExtensions is not available for Silverlight, I am not surprised it is absent here.

One thing you might be able to try is to compile System.Data.DataSetExtensions yourself against the Mono for Android profile. I have no idea if this will work and have not tried it myself, but it would be an easy way to find out if it's possible, and will be much safer than linking to a .NET 4.0 DLL in your application. Mono's implementation of System.Data.DataSetExtensions is available in their Github repository.

Community
  • 1
  • 1
Greg Shackles
  • 10,009
  • 2
  • 29
  • 35
  • I tried the Mono implementation, however it doesn't compile since the guid is wrong. My solution was to rewrite portions of the code that relied on the DataSetExtensions. Also, the Mono implementation is for the moment incomplete. – AstronautTiger Jul 05 '12 at 12:52
  • I am able to compile the `System.Data.DataSetExtensions` project from mono. Thanks Greg Shackles for your answer. – vijayP Apr 02 '14 at 12:43
  • @AstronautTiger Can you please (if possible) share more details about how you rewrote it? I'm kinda new and this to work, Thank you in advance – Reihaneh Khaksaran May 20 '19 at 13:22