我有一个在 Azure 中运行的 MVC Web 应用程序。我们正在使用 的实例Microsoft.Reporting.WebForms.LocalReport
来针对 Web 应用程序正在使用的数据库运行报告。一些数据集非常大,渲染可能需要很长时间。因此,我们决定将报告的呈现作为 Web 作业卸载到单独的应用服务中。该应用程序在我的开发环境中正常运行,但是当它作为 Web 作业上传时,它会崩溃,并在 Web 作业日志中出现以下异常:
[10/30/2017 17:16:48 > 81a023: ERR ] Unhandled Exception: Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report '' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.TypeInitializationException: The type initializer for 'Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion' threw an exception. ---> System.ArgumentException: The path is not of a legal form.
[10/30/2017 17:16:48 > 81a023: ERR ] at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
[10/30/2017 17:16:48 > 81a023: ERR ] at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
[10/30/2017 17:16:48 > 81a023: ERR ] at System.IO.Path.GetFullPathInternal(String path)
[10/30/2017 17:16:48 > 81a023: ERR ] at System.IO.Path.GetFullPath(String path)
[10/30/2017 17:16:48 > 81a023: ERR ] at System.Diagnostics.FileVersionInfo.GetFullPathWithAssert(String fileName)
[10/30/2017 17:16:48 > 81a023: ERR ] at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
[10/30/2017 17:16:48 > 81a023: ERR ] at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion.<>c__DisplayClass1.<.cctor>b__0()
[10/30/2017 17:16:48 > 81a023: ERR ] at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1.<Run>b__0(Object state)
[10/30/2017 17:16:48 > 81a023: ERR ] at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
[10/30/2017 17:16:48 > 81a023: ERR ] at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
[10/30/2017 17:16:48 > 81a023: ERR ] at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion..cctor()
调用该LocalReport.Render()
方法时会引发错误。
报告定义是从数据库中的表中读取的,因此如果需要对报告进行更改,则无需重新编译或重新发布任何内容。
我的问题是,为什么会发生这种情况,我该如何解决?
提前致谢。