Convert Excel file to PDF throws a Reflection Exception instantiating workbook Spire.Xls workbook

463 Views Asked by At

I just want to use Spire to get an Excel file and save as PDF:

Workbook workbook = new Workbook();
workbook.LoadFromFile(@"D:\excels\Report.xlsx", ExcelVersion.Version2016);
workbook.SaveToFile(@"D:\excels\" + name + ".pdf", Spire.Xls.FileFormat.PDF);

but it throws the following exception at the first line:

enter image description here

Is a ReflectionTypeLoadException when trying to load a workbook using Spire.XLS library

I have reinstalled library , set copy to local to true in all references but still throws the exception.

Any ideas?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

well, after performing a deep cleanup of dependencies , packages ..then uninstalling libraries and installing Spire.XLS only (the one I need) again...it worked!