Bug 10095 - System.Data.Services.Client.dll is not linker-friendly.
Summary: System.Data.Services.Client.dll is not linker-friendly.
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.5.x
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-02-06 14:57 UTC by Jonathan Pryor
Modified: 2017-07-04 07:27 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Jonathan Pryor 2013-02-06 14:57:29 UTC
The System.Data.Services.Client.dll is not linker friendly, because it has an internal type -- TypeSystem -- which uses Reflection to look up MethodInfo instances:

https://github.com/mono/mono/blob/master/mcs/class/System.Data.Services.Client/Client/System/Data/Services/Client/ALinq/TypeSystem.cs#L33

e.g.

>             expressionMethodMap.Add(typeof(string).GetMethod("Contains", new Type[] { typeof(string) }), @"substringof");

The problem is that if (when) these members are not preserved by the linker, the Type.GetMethod() invocation will return null, which causes expressionMethodMap.Add() to throw an ArgumentNullException.

The fix would be to remove Reflection use and instead use e.g. Action<object[]> and lambdas instead of MethodInfo.
Comment 2 Sebastien Pouliot 2013-02-11 14:13:36 UTC
MT/XM linker has been fixed for this. Since it's part of the SDK (linksdk) the fix is inside the linker itself.
Comment 5 Prashant [MSFT] 2017-07-04 07:27:27 UTC
Unfortunately, we’re unable to reproduce this report. If this issue is still occurring for you, please reopen this issue and attach a reproduction to the bug by starting with a clean Xamarin.Android project adding just the code necessary to demonstrate the issue.