473,804 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Cultures - Resource lookup failed - infinite recursion detected.

Hi All

I would be very grateful for any help with a problem I am having with
Custom Cultures.

I need to change the date format of a specific culture. I have created
a custom culture that should change the format. But when I run it, it
gives me an [Resource lookup failed - infinite recursion detected.
Resource name: Argument_Adding Duplicate__] error.

My CustomCulture.c s looks like this:

public class CustomCultureIn fo : CultureInfo
{
private string myDescription;
private string myName;
private string myParent;

public CustomCultureIn fo(string parent, string customName) :
base(parent)
{
myParent = parent;
myName = String.Format(" {0}-{1}", parent, customName);
myDescription = String.Format(" Custom Culture ({0})", myName);

DateTimeFormatI nfo dtfi =
(DateTimeFormat Info)base.DateT imeFormat.Clone ();

dtfi.DayNames = new string[]{"Sunday", "Monday", "Tuesday",
"Wednesday" , "Thursday", "Friday", "Saturday"} ;

base.DateTimeFo rmat = dtfi;
}
}

And I call it like so from Global.asax:

Thread.CurrentT hread.CurrentCu lture = new CustomCultureIn fo("ar-ae",
"ang");

When I run it, I get an exception like this:

[ArgumentExcepti on: [Resource lookup failed - infinite recursion
detected. Resource name: Argument_Adding Duplicate__]]
System.Collecti ons.Hashtable.I nsert(Object key, Object nvalue,
Boolean add) +931
System.Collecti ons.Hashtable.A dd(Object key, Object value) +11
System.Resource s.ResourceManag er.InternalGetR esourceSet(Cult ureInfo
culture, Boolean createIfNotExis ts, Boolean tryParents) +558
System.Resource s.ResourceManag er.GetString(St ring name, CultureInfo
culture) +103
System.Web.Http Runtime.GetReso urceStringFromR esourceManager( String
key) +181
System.Web.Erro rFormatter.GetH tmlErrorMessage (Boolean
dontShowSensiti veInfo) +372
System.Web.Http Response.WriteE rrorMessage(Exc eption e, Boolean
dontShowSensiti veErrors) +1385
System.Web.Http Response.Report RuntimeError(Ex ception e, Boolean
canThrow) +441
System.Web.Http Runtime.FinishR equest(HttpWork erRequest wr,
HttpContext context, Exception e) +486
Can anyone help? It would make my day.

Cheers!

James :)

Jul 5 '06 #1
0 2688

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5809
by: netclectic | last post by:
Hi folks, i've searched and searched and can't find any example of what i'm trying to do. Essentially (i think) i need to add a new operator to Number. I'm using eval to evaluate expressions that can be entered by users, these expressions are defined by another app so i can't change the format of the expressions. I've managed to support the majority of operators by supplying my own functions that wrap the equivalent Math functions but...
14
3846
by: sinister | last post by:
I have some CGI programs that spit out error pages when the user enters illegal form input. These custom error pages, while informing the user of errors, are otherwise just standard web pages. Is there a disadvantage to not spitting out a 404 error? I assume 404 isn't just another webpage, but carries with it the information that an error occured---in so simple a manner that it could be used for e.g. link checking. TIA,
0
2378
by: U. Cortez | last post by:
When I try to view a .vb form in an opened project I get an error that reads: This happens with any .vb form, and I've tried removing them from the project and adding them back, but that doesn't solve anything. When I get that pop-up error, it doesn't open the form or do anything else. When I try to build the project, I get a similar error:
1
2154
by: Bret Pehrson | last post by:
I've converted a non-trivial C++ library to managed, and get the following unhelpful linker error: Assignment.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c0001a5). Display.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c000108). The help for LNK2022 is completely useless:
1
3210
by: JZ | last post by:
Hi, I've just ran windows update and got Framework 1.0 Service pack 3 and Framework 1.1 service pack 1 (I think it was 1). I'm using VB.Net 2002. Now when I try to view the windows designer on certain forms I get this error.
8
3910
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the Transfer method, but everything gets me the same error 500. Any help would be appreciated.
0
1326
by: GB | last post by:
All, I raised a problem a while ago about custom cultures in .NET and an error whereby a "Resource lookup failed - infinite recursion detected" exception was raised. Usually this was raised when the custom culture was in use and the application domain was restarted. Anyway, there was nothing on usenet about a solution but eventually I came across one (well, MS provided it themselves when I challenged them about this).
5
1943
by: Tinku | last post by:
I am sorry for asking this silly question, but i don't understand why it is happening please suggest me ================================= #include <stdio.h> int main() { static int i=1; printf("function call: %d time \n", i); i++; main();
1
3738
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a custom control, and want to derive a second control from that control. public class CustomButton : Button { } public class SpecialCustomButton : CustomButton
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.