I have an addin for Revit that uses EPPlus to write Excel files. I was using EPPlus 6.2.19 without issue but just tried to update and it throws an exception creating the file. In this code line:
using (var ep = new ExcelPackage(fileInfo))
I get the exception:
Could not load file or assembly 'Microsoft.Extensions.Configuration.FileExtensions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Could not find or load a specific file. (0x80131621)
I have verified this file exists in my executing directory (version 8.0.23) and I have an assembly resolve handler that should load it from there if Revit doesn’t already. That handler is never called for this dll.
I have experimented with versions and it works up until version 7.0.2 but starting 7.0.3 it throws the exception. This was also the version that EPPlus started directly supporting .NET 8.0 with their package; 7.0.2 and before only packaged for .NET 7.0 which could be coincidental but I think unlikely, I would guess something in that change is where the issue lies.
Interestingly, though, the newer versions do NOT fail my unit tests or throw an exception so it seems like it has to be something in the way Revit is handling the loading that is causing the issue.
Has anyone encountered this? Revit team?