Not able to load file (xlsb 48mb) after upgrading .net core 3.1 to 8.0. Earlier it was working.
Also it is still working on localhost but not on server
Would you please provide more details about the issue, such as the exception stack trace, differences between the two environments(local one that works and the server). And it is very possible that we need your template file to reproduce and trace the issue. Since your file is big one, we think you may upload your template file on any FREE file uploading servers.
Hi, The issue is when we trying to load file into memory it is getting timeout (504). Earlier it was working fine , but now it is only working for files with small size . The change at our end is just an upgrade from .net core 3.1 to 8.0
@Yatish_Pant
Would you like to provide your sample files and test code? Due to the file being too large to upload to the forum, you can first upload it to the cloud and then share the link address on the forum. We will check it soon.
This is a smaller file , but facing issue with this as well
Code
string inputFileName = “File.xlsb”; // source
string csvPath = “outputFile.csv”; //destination
var workbookToSave = new Aspose.Cells.Workbook(inputFileName); // we are getting error at this point
workbookToSave.Save(csvPath);
@Yatish_Pant
By testing on the latest version v24.9 using the following sample code and files, we were able to export CSV format normally. The exported CSV file is 194MB. Please refer to the screenshot of the file. result.zip (45.4 KB)
The sample code as follows:
Console.WriteLine("version: " + CellsHelper.GetVersion());
var workbookToSave = new Aspose.Cells.Workbook(filePath + "PBPresentment_25-09-2024-base-copy.xlsb");
workbookToSave.Save(filePath + "out_net8.0.csv");
The output result:
version: 24.9
If you still have questions, please provide more detailed information. Including but not limited to Aspose.Cells version, operating system information, etc. We will check it soon.
It is possible that the issue was caused by memory issue for large template file. Please try MemorySetting.MemoryPreference when loading the template file:
var workbookToSave = new Aspose.Cells.Workbook(inputFileName, new LoadOptions() { MemorySetting = MemorySetting.MemoryPreference });
using Aspose.Cells;
var workbook =
new Workbook(“input.xlsb”, new Aspose.Cells.LoadOptions() { MemorySetting = MemorySetting.MemoryPreference }); // getting timout 502 error at this line, no exception is being through request just ended and server responded as 502
workbook.Save(“Output.csv”); //Save csv
working with .net 8, Aspose.cell 24.9.0 // also tried lower version
also added below line over docker as per suggestion on Support Forum, but didn’t work for us
RUN apt-get update && apt-get install -y --allow-unauthenticated libc6-dev libgdiplus libx11-dev
Still not working
We cannot reproduce the issue at our end with net8 and Aspose.Cells. For non-windows platforms, please make sure you are using the skiasharp version of Aspose.Cells, because net 8 does not support drawing libraries.
Hi,
We have already tried using skiasharp, we are running this on docker with linux and the code is running fine for files wit size in KB
@Yatish_Pant
Because by our simple test we cannot reproduce the issue, please provide us your docker file so we can make further investigation and test. Thank you.
Docker File Text:
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
Copy csproj and restore as distinct layers
COPY . ./
WORKDIR /app/RenewalCoreV1
RUN dotnet restore
Copy everything else and build
RUN dotnet publish -c Release -o out
Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
RUN apt-get update && apt-get install -y --allow-unauthenticated libc6-dev libgdiplus libx11-dev
RUN cp /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
Install the agent
RUN apt-get update && apt-get install -y wget ca-certificates gnupg
&& echo ‘deb http://apt.newrelic.com/debian/ newrelic non-free’ | tee /etc/apt/sources.list.d/newrelic.list
&& wget https://download.newrelic.com/548C16BF.gpg
&& apt-key add 548C16BF.gpg
&& apt-get update
&& apt-get install -y newrelic-dotnet-agent
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV ASPNETCORE_HTTP_PORTS=80
#RUN mkdir AppData
COPY --from=build-env /app/RenewalCoreV1/out .
ENTRYPOINT [“dotnet”, “RenewalCoreV1.dll”]
Hi @Yatish_Pant
On .net8 linux, we can not use system.drawing.common, please use skiasharp.
This may be the reason for the confusion after upgrading from netcore 31 to NET8.
I made a simple NET8 project that runs on Linux Docker and can be run on Docker Desktop for your reference.
DockerNet8_SkiaSharp8.zip (812.6 KB)
For how to use Aspose.Cells on Linux which relies on versions of skiasharp, please see:
Hi,
It is working now using SkiaSharp.NativeAssets.Linux.NoDependencies.
Thanks for the help and support
We’re glad to hear that your issue has been resolved with the use of SkiaSharp, as suggested. If you have any further questions or comments, please don’t hesitate to reach out to us at any time.