how to fix System.IO.FileNotFoundException: 'Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.19.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17' or one of its dependencies. The system cannot find the file specified.'

Dineshkumar.S 456 Reputation points
2023-02-28T06:24:09.2133333+00:00

I tried to run a excel file in my application and it is showing me the error mentioned below

System.IO.FileNotFoundException: 'Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.19.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17' or one of its dependencies. The system cannot find the file specified.'

code snipper where error throws:

bool isSuccess = CompareFormula(answerPath, out isCorrect, out strResult);
                return Executer.Compare_Do(isSuccess,isCorrect, strResult, out result);

how to fix this and i have updated the openxml to latest version but after that also it shows the same error so do i need to add anything further can anyone suggest me some ideas? Thanks in advance

Developer technologies Windows Forms
Developer technologies .NET Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Dineshkumar.S 456 Reputation points
    2023-03-07T07:09:37.4366667+00:00

    Hey I got that issue fixed and we need to add the DocumentFormat.OpenXml.dll to the bin folder and thanks for the help

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.