This is a migrated thread and some comments may be shown as answers.

Web service error: An entry with the same key already exists

9 Answers 548 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 16 Mar 2010, 09:31 PM
Hello,

I am trying to hook a RadScheduler up to a WebService, but cannot even get the page to render, even after following these directions to the letter. Some relevant facts: I am using VS 2010 b2 and IIS7. I've tried this in both a WebForms project and an MVC project, and I get the same error each time. I'll post the stack trace below. Let me know if there's any other information I can provide you.

Thanks,

Daniel

Stack trace:
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: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[ArgumentException: An entry with the same key already exists.]
   System.Collections.Specialized.ListDictionary.Add(Object key, Object value) +7689715
   System.Web.UI.ClientScriptManager.RegisterExpandoAttribute(String controlId, String attributeName, String attributeValue, Boolean encode) +337
   System.Web.UI.ScriptRegistrationManager.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +115

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +639
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
   System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +3262
   System.Web.UI.WebControls.ValidatorCompatibilityHelper.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +333
   System.Web.UI.WebControls.BaseValidator.AddAttributesToRender(HtmlTextWriter writer) +381
   System.Web.UI.WebControls.RequiredFieldValidator.AddAttributesToRender(HtmlTextWriter writer) +25
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +32
   System.Web.UI.WebControls.BaseValidator.Render(HtmlTextWriter writer) +512
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   Telerik.Web.UI.SchedulerFormContainer.Render(HtmlTextWriter writer) +453
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +15
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +52
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   Telerik.Web.UI.RadScheduler.RenderContents(HtmlTextWriter writer) +65
   Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +127
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +315
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +48
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5274

Version Information: Microsoft .NET Framework Version:4.0.30128; ASP.NET Version:4.0.30128.1

9 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 17 Mar 2010, 09:17 PM
Seriously? No one else has run up against this?

I've tried connecting the Scheduler to a web service in half a dozen test projects and varied every parameter that seemed even halfway related. The problem seems to be the interaction between the <WebServiceSettings> tag under the RadScheduler and the ASP/Telerik <ScriptManager> tag, because if I remove either one, I get a) no errors, but no web service either, or b) a different error (saying that I need a ScriptManager on the page in order to use the RadScheduler).

It's hard to imagine no one else has run up against this, given how basic what I'm trying to do is. Maybe there's something uniquely dysfunctional about my (programming) environment. Any suggestions?

Thanks,

Daniel
0
T. Tsonev
Telerik team
answered on 19 Mar 2010, 12:04 PM
Hi Daniel,

Thank you for providing detailed information about the problem. The problem seems to be that two of the validators in the advanced form have the same ID. Are you using a templated advanced form or just the standard one?

In either case a test project that reproduces the issue will help us a lot in solving the problem. You can open a support ticket and attach it there, if you have one ready.

Regards,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel
Top achievements
Rank 1
answered on 19 Mar 2010, 08:21 PM
I'll do that.

Thanks!
0
Steven Fischer
Top achievements
Rank 1
answered on 30 Apr 2010, 07:55 PM
I'm working in a similar environment and have the same error.  Did this ever get resolved?
0
Daniel
Top achievements
Rank 1
answered on 30 Apr 2010, 08:06 PM
Setting EnableAdvancedForm="false" on the Scheduler cleared up the problem. If I remember correctly, duplicate IDs were being created on the client side. If the above fix doesn't work, try changing the ClientSideIDMode.

Also, I'd advise you to think carefully about whether binding by web service is the route you want to go. About six weeks ago, I wrote myself this note in a comment:

/* Binding by web service isn't going so well. Here are the problems:
                 1. The scheduler's layout is created server-side, so doing something that changes the layout, such as viewing additional resources, is impossible from the client side.
                 2. The client-side API is mostly read-only and not very well-documented (there are lots of JavaScript functions on the Scheduler object that are not even mentioned in the Help pages).
                 3. Client-side grouping doesn't work with web service client-side binding, so you have to bind server-side.
               Overall, the RadScheduler's support of web services is not very robust and it's hard to do anything beyond the basics with it. */

Things could have changed since then, but at the time the web service didn't really seem to provide the full package as far as functionality goes.

Take care,

Daniel
0
Mike Taylor
Top achievements
Rank 1
answered on 04 May 2010, 04:09 PM

Hi,

I encounter exactly the same error.

My scheduler page (binded with a webservice) worked great with VS2008 & Fw3.5.
Since I moved to VS2010 & Fw4.0, I have the same error message:
"An entry with the same key already exists."

Is there a solution to this bug (very annoying)?


Mike




0
Mike Taylor
Top achievements
Rank 1
answered on 04 May 2010, 04:11 PM
I forgot to add that I don't use an Advanced form or template.
0
T. Tsonev
Telerik team
answered on 05 May 2010, 01:13 PM
Hi Mike,

This problem is solved in the latest (2010 Q1) versions. You can download the latest version (SP1) and give it a try.

I hope this helps.

Greetings,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mike Taylor
Top achievements
Rank 1
answered on 05 May 2010, 01:49 PM
Thank you very much, it works great now ^^
Tags
Scheduler
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
T. Tsonev
Telerik team
Steven Fischer
Top achievements
Rank 1
Mike Taylor
Top achievements
Rank 1
Share this question
or