[英]could not load file or assembly ' microsoft.reportviewer.Common version=11.0.0.0'
[英]Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0
我最近将我的 n 层解决方案从.NET 3.5 vs 2008升级到 4.5 Visual Studio 2012 。 除了水晶报告之外,一切都很好,我必须从以下链接http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_5.exe为 Visual Studio 2012 安装新的运行时水晶报告。 安装上述软件包后,我必须解决一些不推荐使用的 CrystalViewer 功能和属性,然后在开发环境(Windows 7 64 位、SQL Server 2005、Visual Studio 2012)中正确呈现报告。 当我在测试环境 windows server 2008 R2 中部署包时,应用程序无法加载,抛出错误无法加载文件或程序集Microsoft.ReportViewer.WebForms,版本 = 11
我设法通过将 DLL 从C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\ReportViewer复制到解决方案的 bin 文件夹并设置属性copylocal = true并部署包来解决 ReportViewer.WebForms 错误。 之后,我收到错误无法加载文件或程序集 'Microsoft.ReportViewer.Common, Version=11.0.0.0 。 我试图在我的机器上搜索那个 DLL,但不能。 当项目在 Visual Studio 中运行时,在Debug-> Windows->Module 中,该文件未在全局程序集缓存中列出,但该文件已安装,但我不知道它是如何安装到全局缓存以及从哪里安装的。 我找到了一种解决方案,我必须从 microsoft 包安装ReportViewer.msi ,但是如果我安装了这个包,它会要求我安装我不想安装的 SQL Server 2012。 任何人都可以帮我解决这个问题。 谢谢
不知道这是否对任何人都有好处,但是搜索所有这些 dll:
您可以在C:\\Windows\\assembly\\GAC_MSIL\\...
找到它们,然后将它们放在项目的引用中。
对于他们每个人说:本地副本,并检查 32 或 64 位解决方案。
您可以安装 Microsoft Report Viewer 2012 Runtime 并更改您的引用,以便它们指向运行时安装的引用。
http://www.microsoft.com/en-gb/download/details.aspx?id=35747
我已经安装了运行时而不要求 SQL Server 2012。在安装之前尝试卸载任何以前版本的报告查看器。
由于Microsoft.ReportViewer.2012.Runtime具有Microsoft.ReportViewer.WebForms
、 Microsoft.ReportViewer.Common
和Microsoft.ReportViewer.ProcessingObjectModel
库,只需在 PM 控制台上运行此命令:
安装包 Microsoft.ReportViewer.2012.Runtime
注意:如果您想完全删除旧的Microsoft.ReportViewer.xxx
引用,您可以从Manage NuGet Packages>Installed Packages菜单中删除它们,然后从项目中的packages.config
文件中删除相关行。 之后在项目建设过程中不会再出现。
希望这可以帮助...
无法加载文件或程序集“Microsoft.ReportViewer.Webforms”或
无法加载文件或程序集“Microsoft.ReportViewer.Common”
我在 Visual Studio 2015 中出现了这个问题。
原因:
缺少对 Microsoft.ReportViewer.Webforms dll 的引用。
可能的修复
第1步:
将“Microsoft.ReportViewer.Webforms.dll”添加到解决方案中。
导航到 Nuget 包管理器控制台作为
“工具--> NugetPackageManager--> 包管理器控制台”。
然后在控制台中输入以下命令,如下所示
PM>Install-Package Microsoft.ReportViewer.Runtime.WebForms
然后它将在“..\\packages\\Microsoft.ReportViewer.Runtime.WebForms.12.0.2402.15\\lib”(您的项目文件夹路径)中安装 Reportviewer.webforms dll
和“..\\packages\\Microsoft.ReportViewer.Runtime.Common.12.0.2402.15\\lib”中的 ReportViewer.Runtime.Common dll。 (您的项目文件夹路径)
第2步:-
删除“Microsoft.ReportViewer.WebForms”的现有引用。 我们需要在我们的解决方案中将这些 dll 文件引用为“右键单击解决方案>引用-->添加引用-->浏览”。 从上述路径添加两个 dll 文件。
第三步:
更改 web.Config 文件以指出 Visual Studio 2015。注释掉 Microsoft.ReportViewer.WebForms 和 Microsoft.ReportViewer.Common 版本 11.0.0.0 并取消注释 Microsoft.ReportViewer.WebForms 和 Microsoft.ReportViewer.Common Version= 12.0.0.0。 如截图所示。
Microsoft.ReportViewer.Webforms/Microsoft.ReportViewer.Common
另请参阅以下链接。
您也可以下载nuget 包。
我对 Winforms 有同样的问题。
对我来说的解决方案是:
Install-Package Microsoft.ReportViewer.Runtime.Winforms
只需安装 Microsot.ReportViewer.2012.Runtime nuget 包,如本答案所示https://stackoverflow.com/a/33014040/2198830
在安装项目的先决条件中添加 Microsot.ReportViewer 2010 或 2012 然后它首先安装 Report Viewer 如果它不在“C:\\Windows\\assembly\\GAC_MSIL ...”中,安装后,它安装设置项目
我有同样的问题。
对我来说的解决方案是:
您必须具有相同版本的: Microsoft.ReportViewer.ProcessingObjectModel 在 C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.ReportViewer.ProcessingObjectModel 中注册,就像您在开发者服务器的 web.config 中注册一样:
就我而言,我只在我的生产服务器中注册了 13. 版本,而我在开发人员服务器中注册了 12. 版本。
解决方案是在生产服务器中安装版本 12.
版本 12。:
然后现在我有版本 12. 在生产和报告工作正常。
*** 安装后记得重置IIS
就我而言,我的项目不需要“Microsoft.ReportViewer.Common.dll”程序集,因此我只是删除了所有引用(项目 -> 添加引用... -> ...)(来自“发布”选项卡的所有要求VS2013 自动删除)并且一切正常。
我解决了这个问题,在 C:\\Windows\\assembly\\GAC_MSIL\\ 中搜索 dll 文件并复制到部署的项目的 bin 目录。 那对我有用。
虽然比较晚,但您可以通过以下链接从 nuget 手动下载所需的 DLL: https ://www.nuget.org/packages/Microsoft.ReportViewer.Runtime.Common/12.0.2402.15
打开文件 .Rar 存档,提取 dll 并将它们手动复制到您发布的 bin 文件夹中。
这个解决方案对我有用。 希望有帮助!!
我通过下载reportviewer.exe并安装它来解决它。 安装完成后,所有相关的程序集都将在 C:\\Windows\\assembly\\GAC_MSIL 中可用,然后您可以在 web config 中引用它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.