UnauthorizedAccessException when using a ViewerImageHandler's GetPages Method

I’m using GroupDocs.Viewer version 18.5.0. This issue did not occur in the version I upgraded from: 17.12

HttpPostedFileBase file = Request.Files[0];
Stream stream = file.InputStream;
byte[] attachmentData = attachmentData = new byte[file.ContentLength + 1];
stream.Read(attachmentData, 0, file.ContentLength);
ViewerConfig viewerConfig = new ViewerConfig() {  };
ViewerImageHandler viewerImageHandler = new ViewerImageHandler(viewerConfig);
List<PageImage> imagePages = viewerImageHandler.GetPages(stream, adminPortalViewModel.FileName);

When run on my server I get the error “Access to the path ‘c:\windows\system32\inetsrv\vs.bin’ is denied.”
When debugging locally in Visual Studio 2017 I get “Access to the path ‘C:\Program Files (x86)\IIS Express\vs.bin’ is denied.”
When I run VS2017 as an admin I do not get an error. Ideally I would like to specify a path to use rather than have it decide for me and use a system directory.

@Chris_Miller,

Thanks for using GroupDocs.Viewer and sharing your issue with us.

Would you also please share with us your operating system details? We shall be looking forward to your response.

I’m running Windows 10 on my local development PC. My Server is Windows Server 2012.

@Chris_Miller,

Thanks for providing the required details.

We are able to reproduce your reported issue at our end. The issue has been logged into our Issue Tracking System as VIEWERNET-1626 for further investigation. We shall keep you informed in case we get any updates in this regard.

We have a client deliverable in like 2 weeks that this issue is holding up. Is there a work around anyone on your end can come up with?

@Chris_Miller,

Thanks for your response.

Please try using the following configuration and check if it works at your end.

ViewerConfig viewerConfig = new ViewerConfig()
{
          CachePath = "D:\\cache", // any folder of your choice
          EnableCaching = true,
 };

ViewerImageHandler viewerImageHandler = new ViewerImageHandler(viewerConfig);
...
...
...

Hope it helps.

That solved my problem! Thank you so much for the quick turn around. Very appreciated.

@Chris_Miller,

You are welcome.

@Chris_Miller,

The issue you have found earlier (logged as VIEWERNET-1626) has been fixed in this release.