Developer forum

Forum » Development » Doublets in cultures

Doublets in cultures


Reply
Hi all,

We suddenly received this exception on all solutions on our development server. Apparently noone did anything to provoke it, but now we're attempting to fix it.

 

Server Error in '/' Application.

An entry with the same key already exists.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: An entry with the same key already exists.

Source Error:

Line 658:                                </td>
Line 659:                                <td>
Line 660:                                    <%=Gui.CultureList(prop.Value("NewsCulture"), "NewsCulture")%>
Line 661:                                </td>
Line 662:                            </tr>

Source File: D:\Dynamicweb.net\Application(19.2.0.0 beta)\Admin\Module\NewsV2\NewsV2_edit.aspx    Line: 660

Stack Trace:

[ArgumentException: An entry with the same key already exists.]
   System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +52
   System.Collections.Generic.TreeSet`1.Add(T item) +5230268
   System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value) +48
   Dynamicweb.Gui.CultureList(String Selected, String Name, Boolean enabled) +400
   Dynamicweb.Gui.CultureList(String Selected, String Name) +7
   ASP.admin_module_newsv2_newsv2_edit_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in D:\Dynamicweb.net\Application(19.2.0.0 beta)\Admin\Module\NewsV2\NewsV2_edit.aspx:660
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618


Apparently there are duplicate values in cultures, so removing the additional key would  probably fix if. But do any of you know how to fix that on the server?

Btw. I reviewed the code for the CultureList in Reflector, and IMHO there's some potential for improvements here;-) Not that that is an excuse for our server setup:)

BR.
Lars


Replies

 
Nicolai Høeg Pedersen
Reply
That is one weird error - seems like CultureTypes.AllCultures returns same culture more than once... Could it be .NET cache - same assembly loaded twice?

Tried iisreset?
 
Reply
Yes, no luck. Haven't tried rebooting yet, though.

BR.
Lars
 
Reply
 
In case anyone else gets this error...

Somehow a custom culture had been installed on the server, da-DK-kl. Apparently DW was fed up with all the danish and decided to crash.
 
I removed the custom culture from C:\WINDOWS\Globalization and everything works again.

BR.

Morten
 

 

You must be logged in to post in the forum