System.UnauthorizedAccessException: 'Access to the path 'C:\WINDOWS\SysWOW64\inetsrv\vs.bin' is denied.'

I am trying to setup Groupdocs.Viewer but receiving the following error when calling “GetPages”, I am using .Net 4.5.1.

System.UnauthorizedAccessException: ‘Access to the path ‘C:\WINDOWS\SysWOW64\inetsrv\vs.bin’ is denied.’

Callstack:

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding)
at  .()
at GroupDocs.Viewer.Handler.ViewerHandler1.( ) at GroupDocs.Viewer.Handler.ViewerHandler1.GetPages(Stream fileStream, String fileName, RenderOptions renderOptions)
at GroupDocs.Viewer.Handler.ViewerHandler`1.GetPages(Stream fileStream, RenderOptions renderOptions)
at GroupDocs.Viewer.Handler.ViewerImageHandler.GetPages(Stream fileStream)

Thanks

Stuart

@stuart.moore

Thanks for using GroupDocs.Viewer and posting your issue here.

In order to investigate your reported issue at our end, we need the following details from you:

  • Version of GroupDocs.Viewer API you are using
  • A simple console application (source code without compilation errors) that can help us to reproduce the issue at our end
  • Sample documents (if the issue is specific to particular documents)

We shall be looking forward to hearing from you.

Within a console app the pages were returned and no errors, in a web project the error occurs. I was not able to upload code so it is included below with a couple of basic instructions to recreate.

Create a new MVC Web application (.Net 4.5.1), replace the Index Method in the home controller and add a reference to GroupDocs.Viewer v18.5.0:

standard pdf from BBC website: bbc_accessible_pdf_master17.pdf (228.0 KB)

public ActionResult Index()
{

        string filepath;

        filepath = @"c:\GroupDocsTemp\bbc_accessible_pdf_master17.PDF"; 

        List<PageImage> images;

        using (FileStream filestream = new FileStream(filepath, FileMode.Open))
        {
            ViewerConfig config = new ViewerConfig()
            {
                EnableCaching = false,
                StoragePath = @"c:\GroupDocsTemp"
            };

            ViewerImageHandler handler = new ViewerImageHandler(config);

            ImageOptions options = new ImageOptions()
            {
                ConvertImageFileType = ConvertImageFileType.JPG,
                JpegQuality = 100
            };

            images = handler.GetPages(filestream);


        }

        return View();

    }

@stuart.moore,

Thanks for providing the 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.

If there are any workarounds in the mean time, such as older version or .Net version change, it would be great to be able to demo your product to our team asap.

@stuart.moore,

Thanks for your response.

As a workaround, please try using EnableCaching = true in the configuration (as shown below) and check if it works at your end.

ViewerConfig viewerConfig = new ViewerConfig()
{
          EnableCaching = true,
          StoragePath = @"c:\GroupDocsTemp",
 };

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

Hope it helps.

That now generates with no errors. Thanks.

@stuart.moore,

You are welcome.

@stuart.moore,

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

Thanks for your help, I’ll give this version a try.

@stuart.moore,

You are welcome.