Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top