Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
GitHub or Developer Community 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.
Created attachment 2438 [details]
This prevents the described crash.
When resolving references, xbuild always goes through dependencies of explicit references. The bugfix for 6708 works fine to keep this from confusing the compiler. However, if the same dependency is found in more than one reference, the program fails with the following stack trace:
/usr/local/lib/mono/3.5/Microsoft.Common.targets: error : Error executing task ResolveAssemblyReference: An element with the same key already exists in the dictionary.
Error executing task ResolveAssemblyReference: System.ArgumentException: An element with the same key already exists in the dictionary.
at System.Collections.Generic.Dictionary`2[System.String,Microsoft.Build.Framework.ITaskItem].Add (System.String key, ITaskItem value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Tasks.ResolveAssemblyReference.ResolveAssemblyFileDependencies (ITaskItem item, System.String parent_copy_local) [0x00000] in <filename unknown>:0
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute () [0x00000] in <filename unknown>:0
at Microsoft.Build.BuildEngine.TaskEngine.Execute () [0x00000] in <filename unknown>:0
at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x00000] in <filename unknown>:0
The attached proposed fix prevents this crash.
This crash won't happen in the current code. I missed a detail in looking at the fix for 6708 (which may or may not have been part of that fix).