Bug 4811 - AllowedReferenceRelatedFileExtensions is not implemented correctly
Summary: AllowedReferenceRelatedFileExtensions is not implemented correctly
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-05-01 18:05 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-10-21 14:42 UTC (History)
3 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 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.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2012-05-01 18:05:49 UTC
xbuild implements AllowedReferenceRelatedFileExtensions by appending to the filename:
string rfile = filename + ext;
https://github.com/mono/mono/blob/master/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs#L410

This is demonstrably incorrect, as it breaks the Mono for Android targets, which set AllowedReferenceRelatedFileExtensions to .dll.mdb;.exe.mdb

So it should actually be:
string rfile = Path.ChangeExtension (filename, ext);
Or maybe both? Needs testing.

Correspondingly, the default value of the AllowedReferenceRelatedFileExtensions property in all the xbuild targets will have to be changed from:
.mdb
to:
.exe.mdb;.dll.mdb;.xml

Note the .xml, added for additional compatibility with MSBuild behavior, as documented in ResolveAssemblyReference docs on msdn.
Comment 1 robin.neatherway 2013-02-15 10:21:49 UTC
I am hitting this bug, and agree with the changes suggested here, although Visual Studio seems to generate files with a .XML extension unhelpfully. Perhaps this search can be case-insensitive?
Comment 2 Mikayla Hutchinson [MSFT] 2013-10-21 14:42:38 UTC
Fixed merged.