Bug 46785 - The "LinkAssemblies" task failed unexpectedly
Summary: The "LinkAssemblies" task failed unexpectedly
Status: RESOLVED DUPLICATE of bug 46509
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- critical
Target Milestone: 7.1 (C9)
Assignee: Radek Doulik
Depends on:
Blocks: 46709
  Show dependency tree
Reported: 2016-11-11 05:04 UTC by adrianknight89
Modified: 2016-11-28 08:51 UTC (History)
6 users (show)

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

logs (2.53 KB, application/x-zip-compressed)
2016-11-11 17:25 UTC, Ben Beckley

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:

Description adrianknight89 2016-11-11 05:04:49 UTC
# Steps to reproduce
I'm trying to compile the attachment project on https://bugzilla.xamarin.com/show_bug.cgi?id=46709 in release mode, but I'm getting the below exception.

# Supplemental info (logs, images, videos)
The "LinkAssemblies" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: variable
   at Mono.Cecil.Cil.VariableIndex..ctor(VariableDefinition variable)
   at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
   at Mono.Cecil.Cil.CodeReader.ReadScopes(Collection`1 scopes)
   at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
   at Mono.Cecil.Cil.CodeReader.ReadDebugInfo()
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
   at Mono.Cecil.MetadataReader.ReadMethodBody(MethodDefinition method)
   at Mono.Cecil.MethodDefinition.<get_Body>m__1(MethodDefinition method, MetadataReader reader)
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
   at Mono.Cecil.MethodDefinition.get_Body()
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	TestApp1.Droid			

# Test environment (full version information)
Win10 Enterprise
VS2015 Update 3
Resharper 9
Comment 1 adrianknight89 2016-11-11 05:06:50 UTC
Please note that the app compiles in Debug mode but not in Release.
Comment 4 dean.ellis 2016-11-25 10:06:24 UTC
@Rodo looks like a Linker issue?
Comment 5 Radek Doulik 2016-11-28 08:51:23 UTC

*** This bug has been marked as a duplicate of bug 46509 ***