Bug 17884 - Changing the managedName of a class that matches a namespace part does not stop the "naming violation" warning
Summary: Changing the managedName of a class that matches a namespace part does not st...
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.12.0
Hardware: PC Mac OS
: --- minor
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2014-02-19 13:39 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-06-02 13:29 UTC (History)
2 users (show)

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

Test case (46.07 KB, application/zip)
2014-02-19 13:39 UTC, Brendan Zagaeski (Xamarin Team, assistant)

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 Brendan Zagaeski (Xamarin Team, assistant) 2014-02-19 13:39:19 UTC
Created attachment 6089 [details]
Test case

## Steps to reproduce

Build the attached test solution in Xamarin Studio or Visual Studio.

## Result

Warning BG8900: Type com.example.testandroidlib.TestAndroidLib: FxDG naming violation: Type name 'TestAndroidLib' matches namespace part 'Testandroidlib'. (BG8900) (BindingProject)

## Additional information

In this binding project, the `TestAndroidLib` class is renamed using the following <attr> element in the Metadata.xml file:

> <attr path="/api/package[@name='com.example.testandroidlib']/class[@name='TestAndroidLib']" name="managedName">BoundTestAndroidLib</attr>

Even though the class is successfully renamed in the resulting .dll, the warning about the FxDG naming violation still appears during the build.

In contrast, renaming the `Testandroidlib` namespace _does_ prevent the warning. For example, if you replace the <attr> element with the following line, the warning goes away:

> <attr path="/api/package[@name='com.example.testandroidlib']" name="managedName">BindingProject</attr>

## Version information

Tested with Xamarin.Android 4.10 and 4.12.
Comment 2 Atsushi Eno 2014-04-02 14:27:21 UTC
Fixed. Thanks for the report. [master a0390f5]
Comment 3 Sunil Kumar 2014-06-02 13:29:46 UTC
We have checked this issue and we are not getting "naming violation" warning on building the attached sample.

Screencast: http://screencast.com/t/gOaDkaA8

Environment info:
=== Xamarin Studio ===

Version 5.1 (build 307)
Installation UUID: 2939b8b4-8977-42bd-82d6-100275ccd9cd
	Mono 3.4.0 ((no/c3fc3ba)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000204

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 5aa4bec
Build date: 2014-06-02 00:04:26-0400

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: /Users/360_macmini/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===


=== Build Information ===

Release ID: 501000307
Git revision: def1bd7785c4bc27f13d0b67d860f5e6700d0dc0
Build date: 2014-05-30 14:10:52-04
Xamarin addins: 11878769601a89ead8775b80241fd6a91ba5ad9e

=== Operating System ===

Mac OS X 10.9.0
Darwin 360-MACMINIs-Mac-mini.local 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

Hence closing this issue.