【问题标题】:IIS 7 Access to the path is denied when trying to generate report尝试生成报告时,IIS 7 对路径的访问被拒绝
【发布时间】:2014-10-24 15:16:41
【问题描述】:

我们在尝试生成未访问文件的报告时收到此错误消息。我们使用的是 IIS 7。

XXX 与 Web 服务器位于不同的服务器上。

2014-10-24 11:04:13,287 [5] ERROR FOUNDATION [(null)] - Access to the path '\\XXX   \file2022.pdf' is denied.
System.UnauthorizedAccessException: Access to the path '\\XXX\file.pdf' is denied.
   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)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.WriteStreamToFile(Stream stream, String filename)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportStreamToFile(Stream stream, DiskFileDestinationOptions options)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
   at GlobalFunctions.GenerateCrystalReport(String reportFileName, String outputFileName, List`1 params) in C:\NetProjects\branches\R7\GUIs\Foundation\App_Code\GlobalFunctions.vb:line 347

【问题讨论】:

    标签: c# vb.net iis-7


    【解决方案1】:

    如果您必须访问这样的文件,请确保您的应用程序池以对该位置具有读取权限的域用户身份运行。

    【讨论】:

    • 身份是网络服务,我将授予什么读取权限?
    • 设置一个自定义帐户,然后授予该帐户的权限
    猜你喜欢
    • 2015-04-06
    • 1970-01-01
    • 2012-07-04
    • 1970-01-01
    • 2021-04-02
    • 1970-01-01
    • 2017-01-24
    • 1970-01-01
    相关资源
    最近更新 更多