症狀
請考慮以下案例:
- 您使用 SQL Server 2012、2014 或 2016 Reporting Services。
- 安裝 Microsoft SQL Server 2014 Service Pack 1、SQL Server 2012 SP3 的較新累積更新或 SQL Server 2016 的累積更新。
- 您執行以程式設計方式產生的 RDL 報告。
在此案例中,您可能會收到如下所示的錯誤訊息:
注意
處理!ReportServer_0-1!1328!01/14/2016-10:58:06:: e 錯誤: 擲回 Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: 報表處理中發生意外錯誤。 ---> System.IO.IOException:處理程序無法存取檔案 'C:\Users\ReportServer\AppData\Local\Temp\kpw4qafn.out',因為另一個處理序正在使用該檔案。
在 System.IO.__Error.WinIOError (Int32 errorCode, 字串 maybeFullPath)
位於 System.IO.File.InternalDelete (字串路徑,布林值 checkHost)
位於 Microsoft.ReportingServices.RdlExpressions.VBExpressionCodeProvider.CompileAssemblyFromDomWithRetry (CompilerParameters 選項、CodeCompileUnit compilationUnit)
位於 Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.InternalCompile (AppDomain compilationTempAppDomain, 布林值 refusePermissions)
位於 Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler。<>c__DisplayClass2。<編譯>b__0 ()
位於 Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext。<>c__DisplayClass1。<執行>b__0 (物件狀態)
位於 System.Security.SecurityContext.runTryCode (物件 userData)
位於 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode 程式碼、CleanupCode backoutCode、物件 userData)
位於 System.Security.SecurityContext.Run (SecurityContext securityContext, ContextCallback callback, Object state)
位於 Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run (ContextBody 回呼)
位於 Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.Compile (IExpressionHostAssemblyHolder expressionHostAssemblyHolder, AppDomain compilationTempAppDomain, Boolean refusePermissions, PublishingVersioning versioning)
位於 Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase3 (ParameterInfoCollection& parameters, Dictionary'2& groupingExprCountAtScope)
位於 Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat (Stream definitionStream、字串& 描述、字串& 語言、ParameterInfoCollection& 參數、DataSourceInfoCollection& dataSources、DataSetInfoCollection& sharedDataSetReferences、UserLocationFlags& userReferenceLocation、ArrayList& dataSetsName、布林值& hasExternalImages、布林值& hasHyperlinks、Byte[]& dataSetsHash)
位於 Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport (PublishingContext reportPublishingContext, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameter, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean&hasHyperlinks, Byte[]& dataSetsHash)
位於 Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat (PublishingContext reportPublishingContext)
--- 已到達內部例外狀況堆疊追蹤的末尾 ---
注意:此錯誤也會記錄在 Reporting Services 記錄中。
解決方式
此問題已在下列 SQL Server 累積更新中修正:
SQL Server 2016 RTM 的累積更新 5
SQL Server 2016 SP1 累積更新 2
SQL Server 2014 Service Pack 1 的累積更新 9
SQL Server 2012 Service Pack 2 (SP2 的累積更新 16)
關於 SQL Server 的累積更新
SQL Server 的每個新累積更新都包含所有 Hotfix,以及先前累積更新所包含的所有安全性修正程式。 查看 SQL Server 的最新累積更新:
狀態
Microsoft 已確認這是「適用對象」一節中列出的 Microsoft 產品中的問題。
參考資料
了解 Microsoft 用來說明軟體更新的術語。