EPPlusSoftware / EPPlus

EPPlus-Excel spreadsheets for .NET
https://epplussoftware.com
Other
1.8k stars 274 forks source link

Could not load file or assembly 'System.Configuration.ConfigurationManager' #1450

Closed Gruski closed 5 months ago

Gruski commented 5 months ago

EPPlus usage

Noncommercial use

Environment

Windows

Epplus version

7.1.2

Spreadsheet application

Excel

Description

A function in a .NET framework v4.8 library referencing and using EPPlus is being called from an ASP.NET core 8 project and fails on the following line in that function:

Using excelPackage As New ExcelPackage()

with error "Could not load file or assembly 'System.Configuration.ConfigurationManager'" There is no mention of this as a dependency in Nuget so not sure why it needs this.

Stack trace: at OfficeOpenXml.ExcelConfigurationReader.GetValueFromAppSettings(String key, ExcelPackageConfiguration config, List`1 initErrors) at OfficeOpenXml.ExcelPackage.Init() at OfficeOpenXml.ExcelPackage..ctor() at ArgoWin.FileHelper.GetXlsReportBinary(String spName, String[] args) in C:\Projects\BOL\FileHelper.vb:line 88

JanKallman commented 5 months ago

The error message tells you what is wrong. EPPlus can not find the 'System.Configuration.ConfigurationManager' assembly for some reason. Make sure it is available in your runtime environment or in the deployment of your application.

Gruski commented 5 months ago

Yes obviously it can't find it. The "for some reason" part is the issue as I have it referenced even though I should not have to because Nuget should pull all the dependencies but I referenced it anyway and still problem. But my question is why even need this library. This is specific to non .net core framework. It should not be needed, and if for whatever reason it is, why isn't nuget pulling it in? And why not working even when I pull it in manually?