We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Error - An item with the same key has already added

I am having an Error - "An item with the same key has already added" 

using  Syncfusion.DocIO.DLS 

My code is

WordDocument doc = new WordDocument();
 string[] files= new String[]{"file1.doc","fill2.doc"};
foreach (string file in files)
        {
                byte[] fileContent = File.ReadAllBytes(file);
                 MemoryStream ms = new MemoryStream(FileData);
            WordDocument mergeContent = new WordDocument(ms);
            doc.ImportContent(mergeContent);
        }
 MemoryStream returnStream = new MemoryStream();
        doc.Save(returnStream, FormatType.Docx);   // THIS LINE SHOWS THAT ERROR


And it is Console Application

Thanks

6 Replies

M. M.Stephen December 13, 2013 09:42 PM UTC

Sorry one mistake in my code

Replace this 

    MemoryStream ms = new MemoryStream(FileData);

By
     MemoryStream ms = new MemoryStream(fileContent);

Thanks


SK Sathish K Syncfusion Team December 16, 2013 07:12 AM UTC

Hi Stephen,

 

Thank you for your interest in Syncfusion products,

 

We are unable to reproduce the mentioned issue with the code snippet given by you. We have prepared a sample to illustrate the same which just uses your code snippet only. Please find the attached sample and modify the sample to reproduce the issue at our side. Also provide us the details about current Essential studio version which you are using.

 

Please let us know if you have any concerns.

 

Regards,

Sathish



GenerateWord_Windows_50c8d4d1.zip


M. M.Stephen December 16, 2013 01:44 PM UTC

Hello Sathis,

    Thanks for reply.But it not working. Please try it with my attachment file.


Data_13d7e054.zip


SK Sathish K Syncfusion Team December 18, 2013 02:21 PM UTC

Hi Stephen,

Thank you for your update,

We are unable to reproduce the mentioned issue with your attachment files. We have used these attachment files in the previous sample we have updated to you. We have attached the video illustration for the same. Please provide us the sample project you have used to reproduce the issue at our side. Thereby we can analyze further and provide you the appropriate solution.

Please let us know if you have any questions.

Regards,

Sathish



video_a7b74b7f.zip


M. M.Stephen December 20, 2013 03:33 PM UTC

Hello Sathish
Is it working in VS2010?


SK Sathish K Syncfusion Team December 23, 2013 11:44 AM UTC

Hi Stephen,

 

Thank you for your update.

 

The updated sample is working fine with all of the Visual studio versions. If you provide us your sample to reproduce the issue at our end it will be helpful to us to find out the exact root cause of the issue, thereby we will provide you the appropriate solution.

 

Please let us know if you have any other questions.

 

Regards,

Sathish

Loader.
Live Chat Icon For mobile
Up arrow icon