C# 无法加载文件或程序集';Microsoft.ReportViewer.Common,版本=11.0.0.0

C# 无法加载文件或程序集';Microsoft.ReportViewer.Common,版本=11.0.0.0,c#,asp.net,.net,visual-studio-2012,reporting-services,C#,Asp.net,.net,Visual Studio 2012,Reporting Services,我最近将我的n层解决方案从.NET 3.5 vs 2008升级到了4.5 visual studio 2012。除了crystal reports之外,一切都很顺利,我必须从以下链接为visual studio 2012安装新的运行时crystal reports。 在安装了上面的包之后,我不得不解决一些不推荐使用的函数和属性 CrystalViewer和之后的报告将在开发环境中正确渲染(Windows 7 64位、SQL Server 2005、Visual Studio 2012)。当我在测

我最近将我的n层解决方案从.NET 3.5 vs 2008升级到了4.5 visual studio 2012。除了crystal reports之外,一切都很顺利,我必须从以下链接为visual studio 2012安装新的运行时crystal reports。 在安装了上面的包之后,我不得不解决一些不推荐使用的函数和属性 CrystalViewer和之后的报告将在开发环境中正确渲染(Windows 7 64位、SQL Server 2005、Visual Studio 2012)。当我在测试环境windows server 2008 R2中部署包时 由于引发错误,应用程序无法加载 无法加载文件或程序集Microsoft.ReportViewer.WebForms,版本=11

我通过复制DLL成功地解决了ReportViewer.WebForms错误
C:\Program Files(x86)\Microsoft Visual Studio 11.0\ReportViewer到解决方案的bin文件夹并设置属性copylocal=true,然后部署包。之后,我收到错误无法加载文件或程序集“Microsoft.ReportViewer.Common,Version=11.0.0.0。我试图在我的机器上搜索该DLL,但无法。当project在visual studio中运行时,在调试->Windows->Module中,该文件未列出,但在全局程序集缓存中安装了该文件,但我不知道如何将其安装到全局缓存以及从何处安装。我找到了一个解决方案,我必须从microsoft软件包中安装ReportViewer.msi,但是如果我安装了这个软件包,它会要求我安装SQL Server 2012,而我不想安装。谁能帮我解决这个问题。谢谢

您可以安装Microsoft Report Viewer 2012运行时并更改引用,以便它们指向运行时安装的引用


我安装了运行时,但没有要求SQL Server 2012。安装之前,请尝试卸载任何早期版本的报表查看器。

不知道这是否对任何人都有好处,但请搜索所有这些DLL:

  • Microsoft.ReportViewer.Common.dll
  • Microsoft.ReportViewer.ProcessingObjectModel.dll
  • Microsoft.ReportViewer.WebForms.dll
  • Microsoft.ReportViewer.WinForms.dll
  • Microsoft.ReportViewer.DataVisualization.dll
您可以在
C:\Windows\assembly\GAC_MSIL\…
中找到它们,然后将它们放在项目的引用中


对于每个问题,请说:本地副本,并检查32位或64位解决方案。

只需安装Microsoft.ReportViewer.2012.Runtime nuget软件包,如本答案所示。

作为Microsoft.ReportViewer.2012.Runtime具有
Microsoft.ReportViewer.WebForms
Microsoft.ReportViewer.Common
Microsoft.ReportViewer.ProcessingObjectModel
库,只需在PM控制台上运行以下命令:

安装软件包Microsoft.ReportViewer.2012.Runtime

注意:如果要完全删除旧的
Microsoft.ReportViewer.xxx
引用,可以从“管理NuGet Packages>Installed Packages”菜单中删除它们,然后从项目中的
Packages.config
文件中删除相关行。之后,它将不会在项目建设期间再次出现


希望这有助于…

在安装项目的先决条件中添加Microsot.ReportViewer 2010或2012,然后,如果“C:\Windows\assembly\GAC\ MSIL…”中没有,则首先安装Report Viewer,然后在安装后,它安装安装项目

您也可以下载。

无法加载文件或程序集“Microsoft.ReportViewer.Webforms”


无法加载文件或程序集“Microsoft.ReportViewer.Common”

我在Visual studio 2015中遇到了此问题

原因:

缺少Microsoft.ReportViewer.Webforms dll的引用

可能的修复

步骤1:

将“Microsoft.ReportViewer.Webforms.dll”添加到解决方案中

导航到Nuget Package Manager控制台,如下所示:

“工具-->NugetPackageManager-->包管理器控制台”

然后在控制台中输入以下命令,如下所示

PM>安装软件包Microsoft.ReportViewer.Runtime.WebForms

然后将Reportviewer.webforms dll安装在“.\packages\Microsoft.Reportviewer.Runtime.webforms.12.0.2402.15\lib”(您的项目文件夹路径)中

以及“.\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版本=12.0.0.0。如屏幕截图所示

另请参阅下面的链接


我也有同样的问题

我的解决方案是:

Install-Package Microsoft.ReportViewer.Runtime.Winforms
必须在C:\Windows\assembly\GAC\U MSIL\Microsoft.ReportViewer.ProcessingObjectModel中注册相同版本的:Microsoft.ReportViewer.ProcessingObjectModel, 就像您在开发者服务器的web.config中注册一样:

就我而言,我只在13岁时注册。版本在我的生产服务器和我有12。开发人员服务器中的版本

解决方案是安装版本12。也在生产服务器中

第12版:

现在我有了版本12。在生产和报告工作中表现良好

***请记住在安装后重置IIS

我决定