Bug 60309 - References to System.Linq.Expressions.dll Library cause Xamarin.Android apps to crash on start-up
Summary: References to System.Linq.Expressions.dll Library cause Xamarin.Android apps ...
Status: NEEDINFO
Alias: None
Product: Android
Classification: Xamarin
Component: Linker ()
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2017-10-22 02:12 UTC by Tejas
Modified: 2017-10-25 13:56 UTC (History)
1 user (show)

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


Attachments
Repro Case (180.76 KB, application/x-zip-compressed)
2017-10-24 23:41 UTC, Tejas
Details


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 for Bug 60309 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description Tejas 2017-10-22 02:12:14 UTC
System.Linq.Expressions is added to my app as a transitive dependency to .NETStandard Library. Since I manage my dependencies through Paket, this gets added to my app.

Works fine in Debug mode, but in Release mode, the app crashes at start-up, with the following message: "Could not load assembly 'System.Linq.Expressions' during startup registration".

Using Visual Studio 2017 15.3, TargetFrameworkIdentifier of MonoAndroid set to 7.1.
Comment 1 Radek Doulik 2017-10-23 18:53:36 UTC
Could you please add an app project that replicates the issue?
Comment 2 Tejas 2017-10-24 23:41:44 UTC
Created attachment 25432 [details]
Repro Case

System.Linq.Expressions.dll (.NETStandard 1.6 version) added manually. Note that doing this via NuGET doesnt hit the issue, since the Nuspec doesnt list any DLLs for MonoAndroid.

However, when using Paket to manage the project, it becomes an issue, since Paket adds .NETStandard DLLs to an Android Project.

You can argue the bug is in Paket, but there's also a bug in Xamarin.Android, since technically it must be capable of running all .NETStandard DLLs.
Comment 3 Radek Doulik 2017-10-25 13:44:31 UTC
The attached project doesn't reproduce the issue for me. (with Xamarin.Android 8.0.0.33)

I don't see where in the project the System.Linq.Expressions assembly would be used?
Comment 4 Tejas 2017-10-25 13:56:08 UTC
Ok I can try upgrading my VS 2017 (I'm on 7.4.3.1).

I dont use this assembly, rather it gets added as a transitive dependency when other nuget packages reference .NETStandard.

As a result, it caused a very hard-to-debug crash, and took me a day to narrow it down.

--- Visual Studio 2017 Info ----

Microsoft Visual Studio Community 2017 
Version 15.3.4
VisualStudio.15.Release/15.3.4+26730.15
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Community

Visual Basic 2017   00369-60000-00001-AA500
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA500
Microsoft Visual C# 2017

Visual F# 4.1   00369-60000-00001-AA500
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.8.00712.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30726.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30726.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30728.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter   3.0.17240.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

GorillaPlayerPackage Extension   1.0
GorillaPlayerPackage Visual Studio Extension Detailed Info

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   1.7
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.2.9000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.0.0.0
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   4.3.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Python   3.0.17240.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Django support   3.0.17240.1
Provides templates and integration for the Django web framework.

Python - IronPython support   3.0.17240.1
Provides templates and integration for IronPython-based projects.

Python - Profiling support   3.0.17240.1
Profiling support for Python projects.

R Tools for Visual Studio   1.1.30817.1931
Provides project system, R Interactive window, plotting, and more for the R programming language.

SettingsWindow Extension   1.0
SettingsWindow Visual Studio Extension Detailed Info

SQL Server Data Tools   15.1.61707.200
Microsoft SQL Server Data Tools

SQL Server Reporting Services   14.0.806.134
Microsoft SQL Server Reporting Services Designers 
Version 14.0.806.134

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.3.4.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.26730.08
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

WebJobs Tools v1.0.0   15.0.30901.0
WebJobs Tools v1.0.0

Xamarin   4.6.3.4 (0841c2aaf)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.4.3.1 (18558b4)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.3.3 (8a39106)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.