Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly load failure #1431

Open
swfaust opened this issue Apr 25, 2024 · 3 comments
Open

Assembly load failure #1431

swfaust opened this issue Apr 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@swfaust
Copy link

swfaust commented Apr 25, 2024

EPPlus usage

Commercial use (I have a commercial license)

Environment

Windows 11

Epplus version

7.1.2

Spreadsheet application

Excel

Description

I have an application that exports Excel files and is an addin to another application (Autodesk Revit is the parent application). I am currently referencing EPPlus 6.2.19 and all is working well. When I upgrade to EPPlus 7.1.2 I start getting errors. When I call the line using (var ep = new ExcelPackage(fileInfo)) I get this error:

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 looked in the compile directory and that file exists (it is version 8.0.23). I also have an assembly resolve handler that should handle loading things from the same directory if necessary and that function never gets called for this dll. I get no compilation errors and no other code changed (we have a fairly simple implementation). Looking through my packages tree, this is a dependency of Microsoft.Extensions.Configuration.Json which is a dependency of EPPlus. When I roll back to 6.2.19 it references this same package but version 7.0 of it and all seems to work.

@swfaust swfaust added the bug Something isn't working label Apr 25, 2024
@swfaust
Copy link
Author

swfaust commented Apr 25, 2024

Did some more experimentation between versions and this happened at version 7.0.3. I can use 7.0.2 just fine but when I move up to 7.0.3 it starts throwing the exception. I also noticed that this is when the package specifically starts targeting .NET 8.0 (which is what Revit 2025 uses hence we do too). It seems like possibly something is off in the 8.0 support?

@AdrianEPPlus
Copy link
Contributor

Hello!

We seem to have issues replicating your issue. Could you create a new project that replicates this error for us to look at?

@swfaust
Copy link
Author

swfaust commented Apr 26, 2024

Ok so after experimenting more it may be something in the way that Revit is loading this. I figured out that my unit tests that run as their own process are passing and exporting successfully in the newer versions as well, even though inside Revit it's not working. I need to delve into it further to see if there is anything else in the unit tests that would cause it to work when the addin application does not. I've also asked Autodesk about this to see if they know why it would be throwing the error. I will see if I can create a reproducible example outside of Revit and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants