I know this is an old thread, but I'm running into this in a very simple .Net Core Razor pages app. The first time the document is viewed, the conversion process runs, then the document is displayed fine. The cache is in the App_Data/DocumentCache directory. If I go back to a previous page, then go to the viewer page, I get the error:
Access to the path "[DocumentCache]:\lock-1hshdfq~1us1d15~1us1d15~18km525.xpz" is denied due to insufficient permissions. Please make sure the current windows identity "JOHNDEV\John Tsombakos" has the required permissions on the path. That user is my current user, and that user has full permissions to App_Data\DocumentCache directory. If I just click the refresh button, the document loads up just fine.
More details:
{
"Type": "GleamTech.AspNet.Core.AspNetCoreException",
"Message": "Access to the path \"[DocumentCache]:\\lock-1hshdfq~1us1d15~1us1d15~1uwjqqe.json\" is denied due to insufficient permissions. Please make sure the current windows identity \"JOHNDEV\\John Tsombakos\" has the required permissions on the path.",
"StackTrace": " at GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerHandler.DownloadDocument(String stateId, String cacheInfoKey)\r\n at GleamTech.Reflection.MethodInvoker._aY._d7(Object instance, Object[] parameters)\r\n at GleamTech.Reflection.MethodInvoker.Invoke(Object instance, Object[] parameters)\r\n at GleamTech.Reflection.MethodInvoker.GleamTech.Reflection.IMethodInvoker.Invoke(Object instance, Object[] parameters)\r\n at GleamTech.AspNet.JsonMethodHandler.ExecuteMethod(MethodConfig methodConfig, Object[] parameterValues)\r\n at GleamTech.AspNet.UI.ComponentHandler`1.ExecuteMethod(MethodConfig methodConfig, Object[] parameterValues)\r\n at GleamTech.AspNet.JsonMethodHandler.Execute()\r\n at GleamTech.AspNet.Core.WebActivationMiddleware.Invoke(HttpContext context, IHostingEnvironment env)",
"InnerException": {
"Type": "GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerException",
"Message": "Access to the path \"[DocumentCache]:\\lock-1hshdfq~1us1d15~1us1d15~1uwjqqe.json\" is denied due to insufficient permissions. Please make sure the current windows identity \"JOHNDEV\\John Tsombakos\" has the required permissions on the path.",
"InnerException": {
"Type": "GleamTech.FileSystems.FileSystemException",
"Message": "Access to the path \"[DocumentCache]:\\lock-1hshdfq~1us1d15~1us1d15~1uwjqqe.json\" is denied due to insufficient permissions. Please make sure the current windows identity \"JOHNDEV\\John Tsombakos\" has the required permissions on the path.",
"StackTrace": " at GleamTech.FileSystems.Physical.PhysicalFileSystem.DoCreateLock(BackSlashPath relativeName)\r\n at GleamTech.FileSystems.FileSystem.CreateLock(String fileName)\r\n at GleamTech.FileSystems.FileSystemLockProvider.GetLock(String name)\r\n at _PV._Y0(DistributedLock currentRequest, IDistributedLockProvider _provider)\r\n at _PV._p4(DistributedLock lockRequest, IDistributedLockProvider _provider)\r\n at GleamTech.DistributedLocking.DistributedLockManager.TryLock(Object requester, String name, Int32 timeoutSeconds, IDistributedLockProvider provider, DistributedLock& grantedLock)\r\n at GleamTech.DistributedLocking.DistributedLockManager.Lock(Object requester, String name, Int32 timeoutSeconds, IDistributedLockProvider provider)\r\n at GleamTech.Caching.FileCache._DY(FileSystem fileSystem, String lockName)\r\n at GleamTech.Caching.FileCache._Py(FileCacheKey cacheKey, String relativeName)\r\n at GleamTech.Caching.FileCacheItem.OpenRead()\r\n at GleamTech.DocumentUltimate.AspNet.DocumentCache.LoadCacheInfo(FileCacheKey cacheInfoKey)\r\n at GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerHandler.DownloadDocument(String stateId, String cacheInfoKey)",
"InnerException": {
"Type": "System.UnauthorizedAccessException",
"Message": "Access to the path 'C:\\Users\\John Tsombakos\\source\\repos\\DocViewer\\DocViewer\\wwwroot\\App_Data\\DocumentCache\\lock-1hshdfq~1us1d15~1us1d15~1uwjqqe.json' is denied.",
"StackTrace": " at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)\r\n at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)\r\n at GleamTech.FileSystems.Physical.FileInfoWrapper.Open(FileMode mode, FileAccess access, FileShare share, FileOptions options)\r\n at GleamTech.FileSystems.Physical.PhysicalFileSystem.DoCreateLock(BackSlashPath relativeName)"
}
}
}
}