Bug 19790 - System.Linq.Expressions.Expression type is stripped away by the linker when set to link SDK Assemblies Only
Summary: System.Linq.Expressions.Expression type is stripped away by the linker when s...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2014-05-14 20:37 UTC by Jon Goldberger [MSFT]
Modified: 2017-04-27 11:32 UTC (History)
2 users (show)

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


Attachments
Test Project (20.84 KB, application/zip)
2014-05-14 20:38 UTC, Jon Goldberger [MSFT]
Details

Comment 1 Jon Goldberger [MSFT] 2014-05-14 20:38:29 UTC
Created attachment 6812 [details]
Test Project
Comment 2 Jon Goldberger [MSFT] 2014-05-14 20:45:13 UTC
System.Linq.Expressions.Expression is stripped by the linker when set to "Link SDK Assemblies Only"

Steps to reproduce:

1. Run the attached test project, make sure release configuration is selected and that the Linker is set as above (should be that way already)
2. Press the Click Me button

Expected behavior: No exception.

Actual behavior: A System.NullReferenceException is thrown.

This was resolved by adding an .xml file and skipping that type. This file is already in the test project with build action set to none. To get the expected behavior above:

1. Change the Build Action of the System.Core.xml file from "none" to "LinkDescription"
2. Run the test project
3. Press the Click me button

Expected behavior: no exception is thrown.
Actual behavior: no exception is thrown. 

The contents of the System.Core.xml file are (for ease of reference to anyone else running into this issue):

<linker>
    <assembly fullname="System.Core">
        <type fullname="System.Linq.Expressions.Expression`1">
        </type>
    </assembly>
</linker>
Comment 4 Alberto GH 2017-04-27 11:32:40 UTC
I'm experiencing this problem in Xamarin.Mac 3.4.21, which doesn't support the LinkDescription build action, so the workaround doesn't work. Could someone from Xamarin take a look at this issue?

Installation details:

Visual Studio for Mac Preview
Version Preview 9 (7.0 build 2943)
Installation UUID: ff1ec941-a4ad-4b44-a3e0-6d0649e39920
Runtime:
	Mono 5.0.0.78 (2017-02/ba317ed) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000078

NuGet
Version: 4.0.0.2323

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
SDK: /usr/local/share/dotnet/sdk/1.0.0-preview2-003131/Sdks
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Xamarin.Android
Not Installed

Xamarin Inspector
Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

Apple Developer Tools
Xcode 8.3.2 (12175)
Build 8E2002

Xamarin.Mac
Version: 3.4.0.21 (Visual Studio Enterprise)

Xamarin.iOS
Version: 10.10.0.21 (Visual Studio Enterprise)
Hash: 675645b0
Branch: d15-2
Build date: 2017-04-22 14:32:46-0400

Build Information
Release ID: 700002943
Git revision: 66a6782a4635dbcdfb0b9bb3f076f46d8fc9b4b6
Build date: 2017-04-24 07:46:52-04
Xamarin addins: e7459e0d456fbb73c2661cfcd237235be4950936
Build lane: monodevelop-lion-d15-2

Operating System
Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

Note You need to log in before you can comment on or make changes to this bug.