PC Review


Reply
Thread Tools Rate Thread

CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator[0]Index was outside the bounds of the array

 
 
Roman
Guest
Posts: n/a
 
      25th Aug 2009
Hi,

We use a function to get the current decimal separator from a
WindowsServer:

CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator[0]

This was running fine for many Years. In the last few months something
happend and this function starts to throw exceptions: Index was
outside the bounds of the array

The function is used from a Windows Service running under the local
system account. The regional settings are ok and it is working when I
call as a user (local admin)

What's going wrong here?

Regards
Roman
 
Reply With Quote
 
 
 
 
Peter Duniho
Guest
Posts: n/a
 
      26th Aug 2009
On Tue, 25 Aug 2009 05:51:24 -0700, Roman
<(E-Mail Removed)> wrote:

> Hi,
>
> We use a function to get the current decimal separator from a
> WindowsServer:
>
> CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator[0]
>
> This was running fine for many Years. In the last few months something
> happend and this function starts to throw exceptions: Index was
> outside the bounds of the array
>
> The function is used from a Windows Service running under the local
> system account. The regional settings are ok and it is working when I
> call as a user (local admin)
>
> What's going wrong here?


Assuming you are correct about exactly where the error is occurring, it
sounds like you have a culture with a NumberFormat property that has no
elements in the NumberDecimalSeparator collection.

Without a concise-but-complete code example that reliably reproduces the
problem, it would be very difficult to anticipate _why_ that might be. It
could be that things are not as "ok" as you think they are with your
OS/.NET installation.

Pete
 
Reply With Quote
 
Roman
Guest
Posts: n/a
 
      31st Aug 2009
Hi Pete,

The error occurs exactly at the line:

char Separator =
CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator[0] ;

Its not possible to set the current culture to non specific culture
(e.g. "en"). If there is a culture without comma separator a 'not
supportet exception' is thrown instead of the Index out of bounds
exception.
Anyway restarting the system helped in this case but there is still
the bad feeling about the occurence of this issue...

Thanks
Roman
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
array index out of bounds Cnewman65 Microsoft Outlook 1 22nd May 2009 01:35 PM
currentCulture.NumberFormat.NumberDecimalSeparator arne.wiklund@intellifield.no Microsoft C# .NET 2 16th Aug 2006 04:22 PM
Array index out of bounds Neil Microsoft Outlook BCM 3 5th Aug 2004 09:22 PM
array index out of bounds Ed Dunlop Microsoft Outlook Discussion 1 15th Jun 2004 06:11 PM
Array index out of bounds Jonathan Microsoft Outlook 0 19th Aug 2003 10:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:58 AM.