An item with the same key has already been added.

An item with the same key has already been added.

Forum member · Nov 18, 2010
We are trying DynamicPDF PrintManager with somes servers it fail when create new printjob but with some machines it works well. Code: Imports ceTe.DynamicPDF.Printing Module Module1 Sub Main() Dim pdfprinter As PrintJob Dim pdfFile As InputPdf Try pdfFile = New InputPdf("test.pdf") pdfprinter = New PrintJob("\\001-dad-w242\multibac", pdfFile) pdfprinter.Print() Catch ex As Exception System.Console.WriteLine(ex.Message & vbCrLf & ex.ToString & vbCrLf) End Try Try pdfprinter = New PrintJob("\\001-dad-w242\multibac", "test.pdf") pdfprinter.Print() Catch ex As Exception System.Console.WriteLine(ex.Message & vbCrLf & ex.ToString & vbCrLf) End Try End Sub End Module Output: E:\Dev9.1\TestPrinterManager_console\TestPrinterManager_console\bin\Debug>TestPrinterManager_console.exe Un élément avec la même clé a déjà été ajouté. System.ArgumentException: Un élément avec la même clé a déjà été ajouté. à System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) à System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) à ceTe.DynamicPDF.Printing.PaperSourceList..ctor(a ) à a..ctor(String , Char* ) à y.a(String ) à ceTe.DynamicPDF.Printing.PrintJob..ctor(String printerName, InputPdf inputPdf) à TestPrinterManager_console.Module1.Main() dans e:\dev9.1\TestPrinterManager_console\TestPrinterManager_console\Module1.vb:ligne 11 Un élément avec la même clé a déjà été ajouté. System.ArgumentException: Un élément avec la même clé a déjà été ajouté. à System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) à System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) à ceTe.DynamicPDF.Printing.PaperSourceList..ctor(a ) à a..ctor(String , Char* ) à y.a(String ) à ceTe.DynamicPDF.Printing.PrintJob..ctor(String printerName, String pdfFileName) à TestPrinterManager_console.Module1.Main() dans e:\dev9.1\TestPrinterManager_console\TestPrinterManager_console\Module1.vb:ligne 17 "Un élément avec la même clé a déjà été ajouté." = "An item with the same key has already been added" DynamicPDFPrintManager101forNETBuild15932.msi have been used for this tests. What is wrong? Best regards

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

Support · Nov 18, 2010
Hello, We did find the issue and have been fixed it. The reason for getting this error is, sometimes our product is not throwing any error when some error occurs in printing and this will continue in creating another job. This is causing the "An item with the same key has already been added." error. We have added some functionality to throw proper errors whenever there is a problem and this error contains the error codes also. You can check the reasons for the error using the system error codes. You can get the latest build by sending a mail to our support team at: [^a|mailto:support@cete.com|opennewiwndow|support@cete.com^]. The latest build dll will give a proper error messages. Thanks, ceTe Software Support Team.