我添加了以下 DLL 并将本地复制设置为 true
Microsoft.ReportViewer.Common.dll 10.0.0.0
Microsoft.ReportViewer.WebForms.dll 10.0.0.0
Microsoft.ReportViewer.ProcessingObjectModel.dll 10.0.0.0
当我浏览应用程序文件夹并抛出 Azure Kudu 时,我可以在 bin 文件夹中看到上面的 DLL。
我总是在生产中遇到此错误,但它在本地运行良好。
“Microsoft.ReportViewer.Common,Version=10.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统找不到指定的文件。”
最佳答案
当您在本地托管 ASP.NET 应用程序时,ReportViewer 程序集通常在 Visual Studio 安装期间直接安装在 IIS 服务器的全局程序集缓存 (GAC) 中,并且可以由应用程序直接访问。但是,当您在云中托管 ASP.NET 应用程序时,Microsoft Azure 不允许将任何内容安装到 GAC 中。
I am always getting this error in the production but It works well locally.
您的 ReportViewer 程序集似乎在本地可用。因此,您可以引用以下建议:
首先,确保您的 Azure 函数正在应用服务计划上运行。
其次,下载 Microsoft Report Viewer 2012 Runtime 可再发行软件包。
然后,在项目中创建文件夹并将关联的资源程序集文件复制到其中,并将属性“复制到输出目录”设置为“始终复制”。
更多详情,您可以引用article .
关于function - Azure 函数中的报告查看器 DLL 加载问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48071431/