using code like
using OfficeOpenXml; // namespace for the ExcelPackage assembly
…
FileInfo newFile = new FileInfo(@\"C:\\mynewfile.xlsx\");
using (ExcelPackag
if your project is .net core edit your project file then add
<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" />
</ItemGroup>
and in your startup.cs
add
System.Text.Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
The problem is in the ZIP file reader (ZipInputStream
). You need to add the encodings like windows-1252
manually:
dotnet add package System.Text.Encoding.CodePages
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
More info here: .NET Core doesn't know about Windows 1252, how to fix?