.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Error: An item with the same key has already been added

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :WCF
 

I get the error An item with the same key has already been added

when I try to invoke a service method in my WPF client, Following is the stack trace

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)




View Complete Post


More Related Resource Links

Error Executing CLR Stored Procedure "Item has already been added. Key in dictionary"

  
Hello, I'm consuming a web service through assemblies in a Sql Server 2005 database. The client was made with VB.net 2005. Everything was fine in the deploy phase but once I compile the assembly generated in my sql server database and try to execute the CLR stored procedure defined in the assembly it crashes throwing the following error: Error: There was an error generating the XML document. Inner Exception: Item has already been added. Key in dictionary: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Key being added: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Where SqlCifin is the name of the assembly, InfoComercial is the web reference namespace and ParametrosConsultaDTO is a complex type defined in the WSDL to encapsulate the request parameters. I tried almost everything but nothing seems to work: Already checked the enviroment variables and . I would appreciate any help you can provide me.  PD: I'm using WSE 3.0. Thanks, Andres Diab.

CLR Stored Procedures with WSE - Error "Item has already been added. Key in dictionary"

  
Hi, I'm developing a CLR Stored Procedure that consumes a Third party Web Service with WSE 3.0 (Due to WS Owners). Everything was fine in the Visual Studio Framework, but once I deploy the assemblies in my database and try to call the service from a query windows, it shows an error message:  Error: There was an error generating the XML document. Inner Exception: Item has already been added. Key in dictionary: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Key being added: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Stack Trace: at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle) at System.Web.Services.Protocols.SoapHttpClientProtocol.Serialize(SoapClientMessage message) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SqlCifin.InfoComercial.InformacionComercialWSServiceWse.consultaXml(ParametrosConsultaDTO parametrosConsulta) at SqlCifin.StoredProcedures.sp_consultaXml(SqlString i_cod_info, SqlString i_motivo, SqlString i_ced_ruc, SqlString i_tipo_ced, SqlXml& o_xml)   I think it has to be something with the WSE but not completely sure. I really need to go t

Error when trying to add calculated column: ' Item has already been added. Key in dictionary:'

  
I created a subsite under a subsite in my MOSS 2007 site collection. Then I am trying to create a 'local' site content type for Quizzes. Next I am trying to create a calculated column and right after I specify Calculated Column as the type I get a mysterious error Now, Root Cause Analyst Name is a    Root Cause Analyst Name is a site column defined in the Root web, and referenced in the parent subsite, but it has nothing to do with my present effort. ? Can I not create content types in a sub-sub-site, or should I create them all in the root web? Here's the error:     Item has already been added. Key in dictionary: 'Root Cause Analyst Name_Root_x0020_Cause_x0020_Analyst_x0020_Name'  Key being added: 'Root Cause Analyst Name_Root_x0020_Cause_x0020_Analyst_x0020_Name'   at System.Collections.SortedList.Add(Object key, Object value)    at ASP._layouts_fldnew_aspx.__Render__control10(HtmlTextWriter __w, Control parameterContainer)    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)    at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)    at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)    at

SPMetal Error: An item with the same key has already been added.

  

I created a Visual Web Part project in VS 2008. Try to create the proxy code for a site using SPmetal. I got this error:

Error: An item with the same key has already been added.

Any idea?

Thanks,

WX


Error by insert new item in dataview sharepoint designer

  

hi,

doesn't any1 know the answer of my question?

i'm trying to create a data view with the edit, delete and insert function.

the edit and delete works fine. only the insert gives me this error:

The data source control failed to execute the insert command.

plz help?


Getting error when a reference is added

  
Hi,      I am new to .Net, i am getting error when i add a reference to my project, i am attaching the error screen shot here, Do i need to addd any reference path anywhere else, i am using VS 2008. Thanks RaviWorking as a software engineer

Error creating Read Item or Read List operation in Sharepoint Designer 2010

  
In terms of high-level requirements, I need to pull in lists from a couple of different web apps.  To do this, I’m using SPD 2010 to create an External Content Type for the list of interest.  I’m able to create a SOAP Service or WCF Service connection just fine.  However, when I try to create the external content type and create a Read Item Operation on one of the GetList or any other Get* (or other Update methods for that matter) methods, I get the following error:"The method that your operation is based on has parameters with complex types that do not have default parameterless constructor.  This kind of data source methods cannot be used in Business Data Catalog."I tried defining an operation on the “AddAttachment” method, and that worked just fine.  I also tried providing default values to the listName and viewName parameters when creating the SOAP Service connection, but still get the error.  Same issue with a WCF Service connection as well. Does anyone know if this is a 2010 issue, or am I approaching this requirement incorrectly?  What are other approaches for connecting to lists that reside in a different web app than yours? 

Error deleting an item from Custom List in 2010

  
I have an issue that I can't figure out, concerning deleting an item from a custom list in SharePoint 2010. If I create a custom list and add a few items, and I attempt to delete one of these items by selecting the checkbox to the left and using the "Delete Item" command on the Ribbon, I get this error (in IE):Object Expectedinplview.jsCode:0Line:2Char:20804URI: <a long nondescriptive URI>Interestingly enough, if I attempt to delete the same item by viewing it and selecting "Delete Item" (in the dialog box), it works that way. It seems like I can't delete items using the command in the Ribbon. This is also true for deleting library document items.Any ideas on how to solve this? I can't seem to find out what this inplview.js file is used for, and it doesn't exist on the server PC (I did a file search for it, and came up empty).Thanks,John

Access Denied/The workflow could not copy the item workflow error after Sharepoint 2010 upgrade

  
We have a sharepoint designer workflow that copies a document from one library to another on the same site.  Before the upgrade to 2007 it worked fine, but now with 2010 it gives an error and cancels the workflow when it gets to the copy list item step.   The error on the workflow page: The workflow could not copy the item. Make sure the source and destination lists have the same columns and column settings.  Access Denied   Specifically it is the "copy list item current item to documentlibrary" sharepoint designer workflow action.   I have given the system account full permissions to the library and double checked that all columns are the same in both libraries. These are the verbose trace logs:   09/01/2010 09:46:04.05 w3wp.exe (0x17C4) 0x093C SharePoint Foundation Workflow Infrastructure 72er Medium System.UnauthorizedAccessException: <nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied. at Microsoft.SharePoint.SPFile.UpdateInternal(Boolean migrationSemantics, Boolean reGhost) at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitCopyFile(Transaction txn, Object[] transData) 09/01/2010 09:46:04.05 w3wp.exe (0x17C4) 0x093C SharePoint Foundation Workflow Infrastructure 72fe High Error in commiting pending workflow batch items: Sys

Item has already been added. Key in dictionary: 'HelpLink.ProdVer' Key being added: 'HelpLink.Pro

  
Hi All, I am getting this error while putting files on remote server. Please suggest me what to do. Following is the stack trace. Void Add(System.Object, System.Object) Item has already been added. Key in dictionary: 'HelpLink.ProdVer' Key being added: 'HelpLink.ProdVer' System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'HelpLink.ProdVer' Key being added: 'HelpLink.ProdVer'    at System.Collections.ListDictionaryInternal.Add(Object key, Object value)    at Microsoft.SqlServer.Management.Smo.SmoException.Init()    at Microsoft.SqlServer.Management.Smo.FailedOperationException..ctor(SerializationInfo info, StreamingContext context)    --- End of inner exception stack trace --- Server stack trace:    at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)    at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)    at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)    

Item has already been added. Key in dictionary: 'HelpLink.ProdVer' Key being added: 'HelpLink.Pro

  
Hi All, I am getting this error while putting files on remote server. Please suggest me what to do. Following is the stack trace. Void Add(System.Object, System.Object) Item has already been added. Key in dictionary: 'HelpLink.ProdVer' Key being added: 'HelpLink.ProdVer' System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'HelpLink.ProdVer' Key being added: 'HelpLink.ProdVer'    at System.Collections.ListDictionaryInternal.Add(Object key, Object value)    at Microsoft.SqlServer.Management.Smo.SmoException.Init()    at Microsoft.SqlServer.Management.Smo.FailedOperationException..ctor(SerializationInfo info, StreamingContext context)    --- End of inner exception stack trace --- Server stack trace:    at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)    at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)    at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)    

Drilldown Causes Error: Invalid offset for item.

  
I have a SSRS 2008 R2 Tablix with two date parameters (StartDate and EndDate). The report generates fine no matter the date range. With a small date range selected (say 1 week) the column/row drilldowns work perfectly. But when I select a wider date range (say a month) and drill into one of the columns I get the following error: An internal error occurred on the report server. See the error log for more details. (rsInternalError) I took a look at the ExecutionLog and the Status showed as rsSuccess for this execution. I then looked in the Error Log and found:  library!ReportServer_0-18!1ba8!09/10/2010-06:22:23:: i INFO: RenderFromSession('/ExigoReports/SalesByStateWarehouse') library!ReportServer_0-18!1ba8!09/10/2010-06:22:24:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: Invalid offset for item. ReferenceID: fffffffffffffbdc, Offset: -1060, Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details.; library!ReportServer_0-18!1ba8!09/10/2010-06:22:30:: i INFO: Exception InternalCatalogException dumped to: C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\Logfiles flags= ReferencedMemory, AllThreads, SendToWatson library!ReportServer_0-18!1ba8!09/10/2010-06:22:30:: w WARN: Microsoft.Re

Restore from Recycle Bin - ItemAdding and Item Added

  
When restoring an item (specifically a document back to a document library) I need to be able to conditionally stop the restore from occuring. Let me tell you why... Say I have a doc lib with a custom column on. The column is of type datetime. The value in the column has to be unique. To do this I have an event receiver on itemupdating which runs a simple CAML query on the list to check that the value I provide is not being used elsewhere. If this test passes the update occurs, if not I do a properties.ErrorMessage="Column must contain a unique value" and a properties.Cancel=true. Simple. My problem is, say someone uploads a document, doc A, and gives it the date 01/01/2011. If I try and upload document B with the same date it will stop me - good. However if document A is deleted and I add my document B with 01/01/2011 it will allow that - still good as nothing in the doc lib has that date. The problem now would be if someone restored document A back to the library document A and B would both have the date 01/01/2011. Not good. I've had a look at the event receivers and the SPItemEventProperties object when a restore is performed and both adding and added fire. During adding there doesn't seem to be any of the original list item meta data available for me to interogate? During itemadded I can see the values on the SPListItem contained within the SPItemEventProper

How to find newly added item in the share point site?

  
How to find the recently added item in the share point page If the any user added the items in the custom list, library, list,Announcement, Picture library,etc......... i need to show all item that added last 2 days. Is that any object model available to find all item in the share point site???Instead of searching every list.

New Item Added to List/Library trigers Alert to non-AD Security Group

  
I am trying to implement an alert when a new item is added to a list. Idealy this alert would be sent to either a SharePoint Group or a AD Distribution Group. I do not have access/authroization to create security groups. The research I have found so far tells me that I can only add AD users and AD mail-enabled security groups through the alert GUI. My questions is first is this a valid finding? Second, if I create a custom workflow can I have the workflow triger on new item added and have it send a notification to the specified SharePoint/Distribution group? Thank you in advance for your assistance.  

Restoring from Site Collection Recycle Bin - Item Added

  
When I restore a list item from the normal recycle bin I can access the item using properties.ListItem. However, when restoring from the Site Collection recycle bin, the listitem is null?! Ok, I thought, the SPItemEventProperties object I have also provides me with WebUrl, ListId and ListItemId so I can spin up a new SPSite with WebUrl, use openweb to get my SPWeb, use ListId to get the correct list and then the ListItemId to get the item. A bit long winded but should get me where I need to be. This would be ok, but at runtime I got an exception list not found. On investigation it seems the WebUrl property is wrong. I've run this on a few different lists/sites and it is consistently wrong! The value I'm seeing is http://[webapp]/sites/[sitecol]/sites/[sitecol]/[web]. Note the repitition of /sites/[sitecol]?! This is really frustrating and very poor. So not only is the ListItem property null(?), but there is no easy way to get the list item manually! Does anyone else see this behaviour? Sharepoint is really testing my sanity this week!    

No Item Exists Error

  
I have a edit form that has a custom list form (call it list A) and several mutli item forms (call these list 1, list 2, list 3) on it. When I try to edit some of the items I get the following error: No item exists at http://stpi35/ResourceAllocation/Lists/Management Fee Survey/EditForm_11.aspx?ID=12&List=f3d96856-bcda-4ef1-ae4e-a0ed0ddb97bc&Source=http://stpi35/ResourceAllocation/Lists/Management Fee Survey/AllItems.aspx.  It may have been deleted or renamed by another user. None of the lists have a column that I created called ID I have noted that if my main item list (list A) has 4 items and one of the supporting lists (list 1) has only 3 items I can edit items 1, 2, & 3 on list A but item 4 causes the error to be thrown. I am guessing the Id = 4 is being somehow applied to list 1 (one of the embedded multi item forms) and since it only has 3 items it is causing the error. The multi item form for list 1 does not have a query string (I am not filter just wanting everything to show) In searching for a solution I came across this article -> http://support.microsoft.com/kb/972225/EN-US The resolution was --> Change the query string parameter from ID to CustomID. Then change the details page from QueryString(ID) to QueryString(CustomID). I can change the query string parameter on the custom list form to CustomID but where is the details page? (If t
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend