本機開發環境下 ReportViewer 報表顯示正常,部署至其他機器時出現組態錯誤:
無法載入檔案或組件 "Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 或其相依性。系統找不到指定的檔案。
來源檔案:web.config第 19 行:<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0..." />
發布流程未正確配置,導致目標機器 bin 目錄缺少必要的 ReportViewer 組件 DLL。
將虛擬目錄下所有相關 DLL 複製至 bin 目錄,確保包含以下三個核心檔案:
Microsoft.ReportViewer.Common.dllMicrosoft.ReportViewer.ProcessingObjectModel.dllMicrosoft.ReportViewer.WebForms.dll部署後重新整理應用程式即可正常載入報表元件。