We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells.GridWeb FileNotFoundException when SessionStorePath is not the default

When viewing a PDF that contains an image, Aspose.Cells.GridWeb throws the following exception if MainWeb.SessionStorePath has been set to something other than the default.

System.IO.FileNotFoundException: Could not find file 'D:\home\site\wwwroot\acwcache\03429b89-892e-b799-f6d8-253eaa47a82d'.
at System.IO.FileSystem.CreateDirectory(string fullPath, byte[] securityDescriptor)
at System.IO.Directory.CreateDirectory(string path)
at    .(string , bool ,     , string )
at Aspose.Cells.GridWeb.MainWeb.()
at Aspose.Cells.GridWeb.MainWeb. ()
at Aspose.Cells.GridWeb.MainWeb.OnPreRender()
at Aspose.Cells.GridWeb.MainWeb.(bool )
at Aspose.Cells.GridWeb.GridWeb2TagHelper.Process(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.TagHelpers.TagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)

If SessionStorePath is left at the default value, the error goes away.

Test Environment

  • Azure App Service (Windows)
  • ASP.NET Core 5
  • .NET 5
  • The problem exists for both version 21.09.0 from NuGet.org and the development build that was given to me in this thread.

Here’s the Excel file I am testing with.

@sam.magura,

We appreciate if you could provide us standalone VS.NET project (using latest fix of Aspose.Cells.GridWeb) to reproduce the issue. We will check your issue soon.

Hello Amjad, I have created a Jira issue for one of our developers to create a minimal repro for you. I will post here again when it is ready!

please provide us a simple demo project to show the issue.

Hello, you can find our minimal repro here: https://github.com/srmagura/aspose-cells-gridweb-cache-repro

I’m not sure if this is the exact same issue that I originally posted about, but it does seem to be related.

Please let me know of any progress on a fix, as we are currently having to do a semi-manual deployment to work around the issue.

@sam.magura,

Thanks for sharing the project.

We have logged a ticket with an id “CELLSNET-49788” for your issue. We will evaluate your issue and figure it out soon.

Once we have update on it, we will let you know.

during the runing of GridWeb ,It will store file info in SessionStorePath(the default path is:AppContext.BaseDirectory\acwtemp)
and It will store other cache info ,for example all the pictures in PicureCachePath.
(the default path is:AppContext.BaseDirectory\acwcache)

when you run in the server container,you need to create those two directories.
or you can set them to other existed directories.

for example

Aspose.Cells.GridWeb.GridWeb.SessionStorePath = @"D:\tmpdel\storage\gridweb\filecache\";
Aspose.Cells.GridWeb.GridWeb mw = new Aspose.Cells.GridWeb.GridWeb();
mw.ID = "gid";
mw.SetSession(HttpContext.Session);
//set acw_client path
mw.ResourceFilePath = "/js/acw_client/";
//set the picture cache ,you need to create this directory
mw.PictureCachePath = @"D:\tmpdel\storage\gridweb\piccache";

in your case,you need to create the directory D:\home\site\wwwroot\acwcache
then it shall be ok

@sam.magura,
We ‘ve updated the demo and add this tip .
Sorry for the inconvenience

Thanks a lot, that worked!

@sam.magura,

Good to know that your issue is sorted out by following the instructions. In the event of further queries or issue, feel free to write us back.