Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Mon Jan 29, 2018 7:34 am

Code: Select all
System.TypeInitializationException: The type initializer for 'spr1836' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at spr1836..cctor()
   --- End of inner exception stack trace ---
   at spr1836..ctor()
   at Spire.Xls.Workbook..ctor()


Got this error with my windows form. The issue is from
Code: Select all
Workbook workbook = new Workbook();


Not sure why it's throwing this exception


I downloaded Spire.Xls from Nuget packages, at the latest version.

I had a look at the dll and the mentions of where spr1836 are location don't really make sense... Used your tutorial on this

Ahlwong
 
Posts: 3
Joined: Mon Jan 15, 2018 7:35 am

Mon Jan 29, 2018 8:59 am

Hello,

Thanks for your feedback. After an initial test, I was unable to reproduce the issue on my side. Please use the attached app and try again. If the issue still exist, please tell us the OS information of your machine(e.g win7 64bit).

Best regards,
Simon
E-iceblue support team
Attachments
WindowsFormsApplication1.zip
(32.62 KiB) Downloaded 195 times
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Jan 29, 2018 9:33 am

When running what you gave, it was fine.

The moment I went back to my program, it through the exception again. \

Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Spire.Xls;
//using Spire.Pdf;
//using Spire.Xls.Converter;
using Newtonsoft.Json;
using System.Windows.Forms;
using System.IO;


These are my list of references that I'm using in my form


When using .net 4.0, it throws a spr1836 error

When using .net 3.5 & .net 2.0 versions, it throws a spr1840 error

Ahlwong
 
Posts: 3
Joined: Mon Jan 15, 2018 7:35 am

Mon Jan 29, 2018 9:58 am

Hello,

Thanks for you reply. I find you are using Newtonsoft.Json, please remove it and other third-party dlls except Spire dlls then try again. In addition, please make sure you have referenced all the four dlls from Spire.Xls including Spire.Common.dll, Spire.License.dll, Spire.Pdf.dll, and Spire.XLS.dll. If any question, please share us a simple app that can reproduce the issue.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Jan 30, 2018 7:07 am

After removing the Newtonsoft dll from my references and NuGet, it fixed the problem.

Thanks

Ahlwong
 
Posts: 3
Joined: Mon Jan 15, 2018 7:35 am

Tue Jan 30, 2018 8:47 am

Hello,

Thanks for your feedback. If any other question, welcome to write back to us.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Aug 06, 2018 10:31 am

Hi, what if you need both?

Rivalani
 
Posts: 1
Joined: Mon Aug 06, 2018 10:00 am

Tue Aug 07, 2018 2:53 am

Dear Rivalani,

Thanks for your post.
Could you please provide further information to describe your issue related to our product? Thanks in advance.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1000
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS