徵兆
請試想下列案例:
-
您使用 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: Report Processing 發生非預期的錯誤。 ---> System.IO.IOEXception:此程式無法存取檔案'C:\Users\ReportServer\AppData\Local\Temp\kpw4qafn.out',因為它正由其他程式使用。
at System.IO.__Error.WinIOError (Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete (String path, Boolean checkHost)
at Microsoft.ReportingServices.RdlExpressions.VBExpressionCodeProvider.CompileAssemblyFromDomWithRetry (CompilerParameters 選項,CodeCompileUnit 編譯Unit)
at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.InternalCompile (AppDomaincompTempAppDomain, Boolean refusePermissions)
at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.<>c__DisplayClass2.<編譯>b__0 ()
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationCoNtext.<>c__DisplayClass1.<Run>b__0 (Object state)
at System.Security.SecurityCoNtext.runTryCode (Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode 程式碼,CleanupCode backoutCode, Object userData)
at System.Security.SecurityCoNtext.Run (SecurityCoNtext securityCoNtext, CoNtextCallback callback, Object state)
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationCoNtext.Run (CoNtextBody 回撥)
at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.Compile (IExpressionHostAssemblyHolder expressionHostAssemblyHolder, AppDomaincompTempAppDomain, Boolean deferredPermissions, PublishingVersioning versioning)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase3 (ParameterInfoCollection& 參數,字典的 2& groupingExprCountAtScope)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat (Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources、DataSetInfoCollection& sharedDataSetReferences、UserLocationFlags& userReferenceLocation、ArrayList& dataSetsName、Boolean& hasExternalImages、Boolean& hasHyperlinks、Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport (PublishingCoNtext 報表PublishingCoNtext, PublishingErrorCoNtext errorCoNtext, String& reportDescription, 字串&報表Language、ParameterInfoCollection&參數、DataSourceInfoCollection& dataSources、DataSetInfoCollection& sharedDataSetReferences、UserLocationFlags& userReferenceLocation、ArrayList& dataSetsName、Boolean& hasExternalImages、Boolean&hasHyperlinks, Byte[]& dataSetsHash)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat (PublishingCoNtext 報表PublishingCoNtext)
---內部例外堆疊追蹤---結尾
注意:此錯誤也會記錄在Reporting Services記錄檔中。
解決方案
此問題已在下列 SQL Server 的累積更新中修正:
SQL Server 2016 RTM
累積更新 2 的累積更新 2 適用于 SQL Server 2016 SP1
的SQL Server 2014 Service Pack 1
每個SQL Server的新累積更新都包含所有 Hotfix 以及先前累積更新隨附的所有安全性修正。 查看SQL Server的最新累積更新:
SQL Server 2014
的最新累積更新SQL Server 2016
的最新累積更新SQL Server 2012 SP3 的最新累積更新
狀態
Microsoft 已確認<適用於>一節中所列的 Microsoft 產品確實有上述問題。
參考資料
了解 Microsoft 用來說明軟體更新的術語。