Assembly Load error from DocumentFormat.OpenXml

5

I get an error using the Microsoft ClosedXml and DocumentFormat.OpenXml NuGet utility packages. After I updated these NuGet packages, (from version 2.7.2 to version 2.8.1), I now get this exception:

Exception System.IO.FileLoadException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

When I look at the relevant assembly in my solution project, it references the correct version, (2.8.1). Looking at the NuGet package manager, there are no references to the old 2.7.2 version (4 projects have references to the new version - 2.8.1). I can find no mention in any of the project references to version 2.7.2. The file in the executing application folder is also the correct one (2.8.1) (from looking at the details tab of the project properties window). Where else in my solution might this reference to the old version number (which apparently is causing this exception) be located?

Additional info: I have done a grep on all the files (including binaries) in the application directory where this is executing, including subdirectories, and the string 2.7.2 is nowhere to be found.

Also, When I debug this in Visual Studio, it works without throwing an exception. But when I run it in the deployed build folder I get the FileLoadException.

.net
closedxml
assembly-loading
asked on Stack Overflow Apr 4, 2018 by Charles Bretana • edited Aug 19, 2019 by Alex B

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0