Bug 13898 - Resource UpdateIdValues() should qualify namespaces
Summary: Resource UpdateIdValues() should qualify namespaces
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.8.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2013-08-09 17:36 UTC by Ashley
Modified: 2013-08-12 08:48 UTC (History)
2 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 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:
Status:
RESOLVED FIXED

Description Ashley 2013-08-09 17:36:02 UTC
Sorry, not sure which compoenent this belongs to.

I am having trouble with the automatically generated resource designer files. If you have the following situation:

- An Android application with the project's default namespace set to, for example 'Company.AndroidApp'
- Existing class library projects with namespaces like 'Company.UsefulLibrary'
- Another android class library project with a namespace 'UsefulLibrary'

Then the resource designer file will be generated containing something like:

namespace Company.AndroidApp
{
...

public static void UpdateIdValues()
{
UsefulLibrary.String.library_name = Company.AndroidApp.Resource.String.library_name;
}

...
}

In this case the compiler tries to resolve 'UsefulLibrary' as 'Company.UsefulLibrary' from the existing class library, rather than the class library called 'UsefulLibrary' as it was intending.

The solution to this is to prefix it, like:

global::UsefulLibrary.String.library_name = Company.AndroidApp.Resource.String.library_name;

Unfortunately I can't make this change manually, as it automatically gets re-generated every time I build and overwrites my changes.

I can work around it by calling my new library something else, but the problem should be fixed anyway.
Comment 1 Atsushi Eno 2013-08-12 08:48:27 UTC
You're right. It will be fixed in the future releases. Thanks.

[master f3bfcc6]