Bug 34327 - CultureAndRegionInfoBuilder' does not exist
Summary: CultureAndRegionInfoBuilder' does not exist
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-09-28 03:20 UTC by Nima Ghaedsharafi
Modified: 2017-06-28 14:56 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 ANSWERED

Description Nima Ghaedsharafi 2015-09-28 03:20:40 UTC
Okay, this is a strange one.

I'm trying to create a custom culture in Xamarin using:

using System.Globalization;

...

var x = new CultureAndRegionInfoBuilder();

But I get the nasty red Resharper error with no options.

The type or namespace name 'CultureAndRegionInfoBuilder' does not exist in the namespace 'System.Globalization'

What's going on, am I missing something? Can't find any help on google...

Xamarin Version: 5.9.4

Errors:

Error CS0103: The name `CultureAndRegionInfoBuilder' does not exist in the current context (CS0103) 
	
Error CS0246: The type or namespace name `CultureAndRegionInfoBuilder' could not be found. Are you missing an assembly reference? (CS0246)
Comment 1 Jonathan Pryor 2015-09-28 14:27:32 UTC
Indeed, that type doesn't exist in the Xamarin.Android profiles. Since it doesn't exist, ReSharper is correct in flagging it as an error.

Furthermore, I'm not sure it's possible to support it:

https://msdn.microsoft.com/en-us/library/system.globalization.cultureandregioninfobuilder(v=vs.110).aspx
> The custom culture can be installed on a computer and subsequently
> used by any application that is running on that computer

I know of no way to do this within Android.
Comment 2 Nima Ghaedsharafi 2015-09-28 15:41:46 UTC
tnx for ur quick answer,

right now microsoft supports for some calendars and cultures like Shamsi, Hijri ..., is there anyway to use persian calendar as default calendar within xamarin ( Android or iOs ) ?
Comment 3 Jonathan Pryor 2015-09-28 17:19:19 UTC
> is there anyway to use persian calendar as default calendar within xamarin

Not that I know of. :-(
Comment 4 Adam Hartley [MSFT] 2017-06-28 14:56:23 UTC
Marking this bug report as resolved due to the answer in Comment 1.