Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed May 08, 2019 1:27 pm

I have an MVC .Net 4.6.1 application that uses both Spire.XLS and Spire.Doc. I am having trouble getting the right combination of dlls so that both the XLS and DOC work.

At the moment Spire.Doc is working, but when I execute "Workbook workbook = new Workbook();" I receive a "The type initializer for 'sprឹ' threw an exception." error.

The referenced Spire dlls are all in the same folder. The versions are as follows:

Spire.Common 2.2.11.6046
Spire.Doc 7.5.14046
Spire.License 1.3.7.46
Spire.Pdf 5.5.2.2046
Spire.XLS 9.5.0.6046

Please provide instructions to fix this situation as this error is happening in our production application. Thanks!

johansec
 
Posts: 7
Joined: Wed May 02, 2018 12:04 pm

Wed May 08, 2019 1:45 pm

If I use Spire.Pdf version 5.4.20.2046 then Spire.XLS works, but when I try to use code that accesses Spire.Doc I get the following message:

System.IO.FileLoadException: 'Could not load file or assembly 'Spire.Pdf, Version=5.5.2.2046, Culture=neutral, PublicKeyToken=663f351905198cb3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

johansec
 
Posts: 7
Joined: Wed May 02, 2018 12:04 pm

Thu May 09, 2019 5:49 am

Hello,

Thanks for your inquiry.
Please kindly note that Spire.Doc and Spire.XLS are independent products, you need to reference the corresponding dlls (Spire.Common.dll, Spire.Doc.dll, Spire.License.dll, Spire.Pdf.dll and Spire.XLS.dll) from our Spire.Office package (at present the latest version is Spire.Office Platinum (DLL Only) Version:4.4.1) to avoid the incompatibility when using Spire.Doc and Spire.XLS in one project. Besides, please refer to the tutorial (How to Apply two licenses or more) to apply two licenses or more. If there is any question, welcome to write back.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1271
Joined: Wed Apr 25, 2018 3:20 am

Thu May 09, 2019 12:04 pm

Thank you. That solved our problem.

johansec
 
Posts: 7
Joined: Wed May 02, 2018 12:04 pm

Fri May 10, 2019 12:57 am

Hello,

Glad to hear that! If you encounter any issue related to our products in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1271
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.XLS