Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.


What I have tried:

<pre>
Install Microsoft Office 2010 and MICROSOFT OFFICE 2010 PRIMARY INTEROP ASSEMBLIES
Posted
Updated 10-Sep-20 20:29pm
Comments
F-ES Sitecore 10-Sep-20 6:41am    
Automating Excel from asp.net isn't supported so I wouldn't spend too much time trying to resolve this. Instead use a library that is supported in asp.net.
Sandeep Mewara 11-Sep-20 2:49am    
You trying to import data from excel in a web application?

Quote:
All current versions of Microsoft Office were designed, tested, and configured to run as end-user products on a client workstation. They assume an interactive desktop and user profile. They do not provide the level of reentrancy or security that is necessary to meet the needs of server-side components that are designed to run unattended.

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
[^] So, if you are trying to InterOp with Excel on a server: you can't.

However, you can write a .NET app that can interop with the end-user's (client-side) installed, licensed, Excel, and that app can make calls to your server. For ideas about interaction using node.js on the sever: [^].
 
Share this answer
 
v2
It probably means that the version you have installed does not match the version your reference specifies.

Remove the reference from your Project, then add it back and rebuild.
If that doesn't solve it, start looking for assemblies you use that might be referencing Interop and see if they can be rebuilt using the currently installed version.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900