EasyXLS

Why do I get "Could not load file or assembly EasyXLS" error?

Concept

The following error might occur at runtime when using EasyXLS Excel library:

Could not load file or assembly 'EasyXLS, Version=8.6.0.0, Culture=neutral, PublicKeyToken=632c31013494909a' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Possible reason #1: Windows 64-bit, Visual Studio project and EasyXLS.dll for 32-bit

If the EasyXLS version for 32-bit is used on a Windows 64-bit operating system, check the project properties and make sure that the target machine is set to x86.

C#.NET
VB.NET
C++.NET

Possible reason #2: Visual Studio project and EasyXLS.dll for 64-bit

If the EasyXLS version for 64-bit is used, check the project properties and make sure that the target machine is set to x64 or Any CPU for a Windows 64-bit operating system.

EasyXLS.dll for 64-bit cannot run on Windows 32-bit operating system. EasyXLS.dll for 32-bit must be used at runtime.

C#.NET
VB.NET
C++.NET

Possible reason #3: Windows 64-bit, IIS Server (web application) and EasyXLS.dll for 64-bit

If the EasyXLS version for 64-bit is used on a Windows 64-bit operating system, make sure that IIS allows running of 64-bit applications.

Open Internet Information Services (IIS) Manager on Control Panel/Administrative Tools. Select Application Pools and the application pool associated with your web application.

IIS Application Pools

Select Advanced Settings and check if Enable 32-bit Application option is set to false.

IIS 64-bit applications

If running from Visual Studio environment, be sure that the application pool and platform target settings are matching (see Possible reason #1 and Possible reason #2 for details).

Possible reason #4: Windows 64-bit, IIS Server (web application) and EasyXLS.dll for 32-bit

If the EasyXLS version for 32-bit is used on a Windows 64-bit operating system, make sure that IIS allows running of 32-bit applications.

Open Internet Information Services (IIS) Manager on Control Panel/Administrative Tools. Select Application Pools and the application pool associated with your web application.

IIS Application Pools

Select Advanced Settings and check if Enable 32-bit Application option is set to true.

IIS 32-bit applications

If running from Visual Studio environment, be sure that the application pool and platform target settings are matching (see Possible reason #1 and Possible reason #2 for details).

Possible reason #5: Visual Studio Development Server (web application) and EasyXLS.dll for 64-bit

If the EasyXLS version for 64-bit is used in a web application that uses Visual Studio Development Server as web server, the error occurs because Visual Studio Development Server always run on 32-bit.

Possible solutions are:

I) Use EasyXLS.dll 32-bit

II) Go to project properties, Web tab and check "Use Local IIS Web server" and configure IIS server to support 64-bit applications (see Possible reason #3).

Visual Studio, project properties on Web tab

Possible reason #6: Visual Studio, IIS Express (web application) and EasyXLS.dll for 64-bit

If the EasyXLS version for 64-bit is used in a web application that uses IIS Express as web server, the error occurs because IIS Express runs on 32-bit by default.

To check if Visual Studio is using IIS Express to run your web page, go to project properties, Web tab and check Servers section:

IIS Express on Visual Studio

Possible solutions are:
  1. Go to Tools, Options, Projects and Solutions, Web Projects and check "Use the 64 bit version of IIS Express" (for Visual Studio 2013 or later)
  2. Use EasyXLS.dll 32-bit
  3. Go to project properties, Web tab, check "Use Local IIS Web server" and configure IIS server to support 64-bit applications (see Possible reason #3).
  4. Go to project properties, Web tab and unselect the checkbox "Use IIS Express"
  5. Run the 64-bit IIS Express by executing the following command manually:
"C:\Program Files\IIS Express\iisexpress.exe" /config:"U:\IISExpress\config\applicationhost.config" /site:"YourSite.Web" /apppool:"Clr4IntegratedAppPool"

Open Project properties, select "Web" tab, "Use Custom Web Server", and enter the URL to your site.

In order to Debug, go to debug > Attach to Process... and then select your running IIS Express instance.

Possible reason #7: Publishing a web site project in Visual Studio

When publishing a web site project type, Visual Studio uses AnyCPU as platform target by default if "Precompile during publishing" option is used:

Publish website options in Visual Studio

This behavior can be changed by updating "website.publishproj" file, "Platform" tag:

<Platform Condition=" '$(Platform)' == '' ">x64</Platform>    for EasyXLS.dll 64bit
or
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>    for EasyXLS.dll 32bit

Contact us for any other reasons

If none of the above, contact us at support@easyxls.com with details about your application configuration and the full error message.


Available for: Professional, Excel Writer, Excel Reader, Express Excel Writer
Go to top

EasyXLS Excel libraries:

.NET
.NET Excel Library
full .NET version to import, export or convert Excel files
.NET Excel Writer
.NET version to create and export Excel files
.NET Express Excel Writer
.NET version to write and export Excel files
.NET Excel Reader
.NET version to read and import Excel files
Download EasyXLS™ Excel Library for .NET

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2010
MS Excel 2013
MS Excel 2016
MS Excel 2019
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT