By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

"Resource lookup failed - infinite recursion detected" and Custom Cultures

P: n/a
GB
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).

In some situations the localisation plumbing uses the class hash code
behind the scenes. If your custom culture class is not overridding this
then the .NET framework can get confused as the custom culture class
looks identical to its parent (in my case my custom welsh object looked
identical to its parent en-GB object). Override the hash code in the
custom object;

public override int GetHashCode()
{
return (this.Name.GetHashCode());
}

Hey, presto... problem solved.
Cheers.

Jul 3 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.