Access to the path '\FastReport\' is denied.

I am running FastReport V1.9.1.0 (FastReport.DLL & FastReport.Web.dll). They are both contained within the BIN Directory and IIS_USRS has full control of this file anf the directory.
I keep getting an Access Denied Error which causes the report function to fail. It seems to be happening more frequently and on a random basis.

An error like this:

Access to the path '\FastReport\' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path '\FastReport\' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[UnauthorizedAccessException: Access to the path '\FastReport\' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7719199
System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity) +7571081
System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) +150
FastReport.Utils.Config.LoadConfig() +113
FastReport.Utils.Config.Init() +55
FastReport.Report..cctor() +5

[TypeInitializationException: The type initializer for 'FastReport.Report' threw an exception.]
FastReport.Report..ctor() +0
FastReport.Web.WebReport.get_Report() +28
FastReport.Web.WebReport.PrepareReport() +193
FastReport.Web.WebReport.OnLoad(EventArgs e) +64
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627



It happens on a random basis and the only way I have found to get out of it is to restart IIS which is not ideal. I have checked the access permission on the directory and it looks OK so there must be something else I am not doing. As a secondary issue this then causes an exception on the Server "An unhandled exception ('System.TypeInitializationException') occurred in w3wp.exe [5912].

Help.....
Gus

Comments

  • edited 8:07PM
    I'm not sure what happens there but you may take a look at the FastReport.Utils.Config.LoadConfig function. It seems that FastReport wants to load some configuration from a given directory. I would try to run the ProcessMonitor to see where the process tries to access its FR.NET configuration when showing a WebReport.
  • edited 8:07PM
    Sorry it was suggested that I put
    Imports FastReport.Utils
    
    at the start of my Form and
    Config.WebMode = True
    
    in the main code.

    This seems to work in some places but still getting errors as above.
    Sorry for my ignorance but which Process monitor as I would really like to get to the bottom of this.

    Cheers

    Gus

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.