Microsoft.ReportViewer.Common版本=12.0.0.0

Microsoft.ReportViewer.Common Version=12.0.0.0

我的 Windows 服务应用程序出现以下异常:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

我找不到版本 12 的下载 url 并将文件设置为 "Include" 和 "Prequisite (Auto)" 并不能解决此 Windows 服务应用程序中的问题,尽管它在我的 WinForms 应用程序中运行良好,并导致包含和引用适当的文件以及所有其他必需的 .DLL。

有人可以帮助我获取此 Windows 服务应用程序以包含文件,或者引导我下载 link 将在 GAC 中安装版本 12 吗?

ReportViewer 位的版本 12 称为 Microsoft Report Viewer 2015 Runtime,可以从以下 link 下载安装:

https://www.microsoft.com/en-us/download/details.aspx?id=45496

更新:

ReportViewer 位也可作为 NUGET 包使用:https://www.nuget.org/packages/Microsoft.ReportViewer.Runtime.Common/12.0.2402.15

Install-Package Microsoft.ReportViewer.Runtime.Common

我在这个问题上工作了几天。安装了所有软件包,修改了 web.config 仍然有同样的问题。我终于删除了

<assemblies>
<add assembly="Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</assemblies>

来自 web.config 并且有效。不确定为什么它不能与 web.config 文件中的标签一起使用。估计GAC和BIN文件夹有冲突。

这是我的 web.config 文件:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <httpHandlers>
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />     
    </httpHandlers>    
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />      
    </handlers>
  </system.webServer>
</configuration>

在我的案例中,通过 Visual Studio 2015 安装程序安装 Sql 服务器数据工具后,问题已解决

Here is the screenshot for installing data tools

首先安装 SQLSysClrTypes for Ms SQL 2014 然后安装 ReportViewer for ms sql 2014

重新启动您的应用程序或项目,在我的情况下它已解决。

我在 IIS 服务器 PC 上部署后遇到此错误。

  1. 首先安装 Microsoft SQL Server 2014 功能包

https://www.microsoft.com/en-us/download/details.aspx?id=42295enter link description here

  1. 安装 Microsoft Report Viewer 2015 Runtime 可再发行组件包

https://www.microsoft.com/en-us/download/details.aspx?id=45496

可能需要重新启动计算机。

问题

解析器错误消息:无法加载文件或程序集 'Microsoft.ReportViewer.WebForms / Winforms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' 或其依赖项之一。系统找不到指定的文件。

原因

Microsoft ReportViewer 运行time 和 SQL SQL Server 2014 的 CLR 类型是 运行 所必需的,并且在托管 Internet 信息服务 (IIS) 的服务器中缺失或您的应用程序。

分辨率

在 IIS 服务器上安装以下软件包,然后重新启动系统:

下载Microsoft ReportViewer runtime

下载Microsoft SQL CLR types for SQL Server 2014

重新启动后再次连接到 Web 服务/您的应用程序并验证错误是否已解决。

或者您不能按照此 link 阅读更多内容。

此处 link 为 webreports 版本 12 https://www.nuget.org/packages/Microsoft.ReportViewer.WebForms.v12/12.0.0?_src=template

包安装后

在你的工具箱上浏览 dll 将其引用到 bin 然后就是这样 运行 visual studio