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

Type exists in both Syncfusion.XlsIO.Base and Syncfusion.XlsIO.Portable

I am using Syncfusion.EJ2.Spreadsheet.AspNet.Core in a .NET 4.8 web application (with Wisej). This is working fine but I also need to convert excel sheets to PDF, so I have added the Syncfusion.XlsIORenderer.Net.Core nuget package as well. After this I get compiler errors:

Error CS0433 The type 'ExcelEngine' exists in both 'Syncfusion.XlsIO.Base, Version=20.3460.0.58, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' and 'Syncfusion.XlsIO.Portable, Version=20.3200.0.59, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' WisejWebApplication1 

How can I solve these?

I have attached a sample application.


Attachment: WisejWebApplication1_49fd2176.zip

3 Replies 1 reply marked as answer

SP Sangeetha Priya Murugan Syncfusion Team December 7, 2022 01:51 PM UTC

Hi Andrea ,


In your provided sample, you referred to the Target Framework 4.8 but installed the ASP.Net Core NuGet packages. So only the issue occurs; instead of using Core packages, we suggest you use the MVC NuGet packages to resolve this issue on your end. And we have modified your application based on our suggestions. Please find the link below.


 Sample Link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/WisejWebApplication11997310531


Documentation Link: https://ej2.syncfusion.com/aspnetmvc/documentation/spreadsheet/open-save#server-dependencies


To save/open the excel file in server, please refer to the below link for MVC controller codes.


https://www.syncfusion.com/kb/11970/how-to-open-and-save-an-excel-file-to-server-in-the-spreadsheet


Could you please check the above links and get back to us with more details, like screenshots or video demonstrations with samples? Based on that, we will check and provide you with a better solution quickly.



AB Andrea Bradea replied to Sangeetha Priya Murugan December 19, 2022 08:46 AM UTC

Thanks for the sample, it works when I use the MVC nuget packages, but now I have the next problem; when I also add the MVC version of the WordEditor, I get a runtime error when I try to load a word document:

Could not load file or assembly 'Syncfusion.Compression.Base, Version=20.3450.0.61'

I have attached an updated sample; just press the Load button on the top to get the error.


Attachment: WisejWebApplication1_8d028fdf.zip


SM Suriya Murugan Syncfusion Team December 23, 2022 05:08 AM UTC

Andrea, we have modified the provided sample and resolved the reported issue. For compression and office chart, we have to add redirection


In web.config file added below.


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Syncfusion.OfficeChart.Base" publicKeyToken="3D67ED1F87D44C89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-20.3460.0.61" newVersion="20.3460.0.61"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Licensing" publicKeyToken="632609B4D040F6B4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-20.3460.0.61" newVersion="20.3460.0.61"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Compression.Base" publicKeyToken="3D67ED1F87D44C89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-20.3460.0.61" newVersion="20.3460.0.61"/>
</dependentAssembly>
</assemblyBinding>
</runtime>



Attachment: WisejWebApplication1_b9b65332.zip

Marked as answer
Loader.
Up arrow icon