I am trying to autofit columns in a .NET Core Console application.
This statement causes a FileNotFoundException
:
worksheet.Columns[i].AutoFit(1, worksheet.Rows[1], worksheet.Rows[worksheet.Rows.Count - 1]);
I have cloned your examples from GitHub.
You can reproduce the issue by slightly modifying your example RowAndColumnAutoFit.
Open the RowAndColumnAutoFit.csproj file and change the TargetFrameworks:
From: <TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks>
To: <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
You will now get the error.
If you add a reference to System.Drawing.Common
, the issue is resolved