I am trying to autofit columns in a .NET Core Console application.
This statement causes a
worksheet.Columns[i].AutoFit(1, worksheet.Rows, 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:
You will now get the error.
If you add a reference to
System.Drawing.Common, the issue is resolved