Bug 10946 - xbuild ITaskItem.GetMetadata() suffers from "Turkish I" bug
Summary: xbuild ITaskItem.GetMetadata() suffers from "Turkish I" bug
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-03-06 14:13 UTC by Jonathan Pryor
Modified: 2013-03-06 22:43 UTC (History)
1 user (show)

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:

Description Jonathan Pryor 2013-03-06 14:13:41 UTC
xbuild improperly compares strings in a case-insensitive fashion.


The scenario:

1. Run OS X with a user in a Turkish locale
2. Create a Xamarin.Android project.
3. Build.

Expected result: no error.

Actual result:

> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
> Error: Error executing task AndroidComputeResPaths: Invalid reserved metadata name (Test)

The cause s that AndroidComputeResPaths.Execute() calls ITaskItem.GetMetadata("Identity") (among others), which eventually hits ReservedNameUtils.GetReservedMetadata(). Due to the improper lowercasing, "Identity".ToLower() results in "ıdentity" instead of "identity", which doesn't match anything in the `switch` statement. Result: exception.

Every use of `.ToLower()` within xbuild needs to be reviewed and possibly replaced with `.ToLowerInvariant()`.
Comment 2 Jonathan Pryor 2013-03-06 22:43:11 UTC
Fixed in 2d37d817: https://github.com/mono/mono/commit/2d37d817