I'm attempting to utilize the recently released .NET Core 7 alongside MS Office, using the interop assemblies to import data from an Excel sheet into a SQL Server table. However, I'm encountering the error message

'Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'office, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified.File name: 'office, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c''.
We have Microsoft Excel 365 installed, I'm using Visual Studio 2022, and I've created a .NET Core application where I use an Excel file as input to retrieve data.

After struggling for about an hour, we discovered that the issue because we using .NET Core 6 without including COM references in our project.

We were attempting to integrate the recently-released .NET Core with MS Office using the interop assemblies, With Visual Studio 2022 or VS2019, we can now add COM references directly from the IDE, simplifying the process.

It's essential to recognize the significance of including COM references when working with .NET Core and MS Office integration. Without these references, the necessary interop assemblies may not be available, leading to runtime errors.

By leveraging the IDE's capability to add COM references, we can streamline the integration process and ensure the smooth operation of our application with MS Office functionalities.


We encountered the error message "Could not load file or assembly 'office, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified" in our ASP.NET Core application.

  • To resolve this issue, we need to ensure that the necessary assembly is installed or referenced correctly in our project and first, let's check if the 'office' assembly is referenced in our project dependencies. If not, we need to add it.
  • If the assembly is already referenced, ensure that the version specified matches the version mentioned in the error message (Version=

Make sure that the 'office' assembly is installed in the GAC (Global Assembly Cache) on the system where the application is running. If not, you may need to install it using a package manager or manually copy the assembly to the appropriate location.


You can try adding the "OFFICE.DLL" reference should solve the issue for you if issue not solved then try this approach.

If  you're encountering an error message even though you have Office 2013 installed, and then check if  Microsoft.Office.Interop.Excel folder is present under the GAC.

The solution involves referencing two DLL files from specific folders:

By referencing these DLL files, you should be able to resolve the issue. It's possible that the required interop assemblies were missing, causing the error.

I found that solution in Stack Overflow, as they often provide valuable resolutions to common issues.


In my experience, if we want to perform operations with an Excel file, we need to ensure that machine has the corresponding version of Office installed. For example, version corresponds to Office 2013, so Office 2013 should be installed on target machine.

This is particularly important if I'm using MS Office interop libraries, as they only work if Office is installed and against the same version of MS Office interop libraries.

If you encounter compatibility issues with the version, you can try changing the version as per the Office version installed on my computer.

You can also try by adding a project reference  if you using VS 2019 or latest with asp .net core project ,
Then go to Dependencies>Add Project Reference>Browse and then select OFFICE.DLL
 else go to Project -> Add Project Reference -> Browse, and then selected OFFICE.DLL 

Folder Path C:\Windows\assembly\GAC_MSIL\office\"