我的Windows服务应用程序中出现以下异常:
System.IO.FileNotFoundException:无法加载文件或程序集 ' Microsoft.ReportViewer.Common,Version = 12.0.0.0,Culture = neutral, 公钥= 89845dcd8080cc91'或其中一个依赖项。该 系统找不到指定的文件。
我找不到版本12的下载网址,并将文件设置为" Include"和"先决条件(自动)"虽然它可以在我的WinForms应用程序中正常工作并且导致包含和引用相应的文件以及所有其他必需的.DLL,但是并没有解决此Windows服务应用程序中的问题。
是否有人可以帮助我获取此Windows服务应用程序以包含文件,或者引导我到将在GAC中安装第12版的下载链接?
答案 0 :(得分:35)
ReportViewer位的第12版称为 Microsoft Report Viewer 2015 Runtime ,可以从以下链接下载以进行安装:
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
答案 1 :(得分:4)
我在这个问题上工作了几天。安装所有包,修改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>
答案 2 :(得分:1)
在我的情况下,在Visual Studio 2015安装程序安装Sql server数据工具后,问题已解决
答案 3 :(得分:1)
解析器错误消息:无法加载文件或程序集“ Microsoft.ReportViewer.WebForms / Winforms,版本= 12.0.0.0,Culture = neutral,PublicKeyToken = 89845dcd8080cc91”或其依赖项之一。系统找不到指定的文件。
运行SQL Server 2014的Microsoft ReportViewer运行时和SQL CLR类型是必需的,托管Internet Information Services(IIS)或应用程序的服务器中缺少这些类型。
在IIS服务器上安装以下软件包,然后重新启动系统:
下载Microsoft ReportViewer runtime
下载Microsoft SQL CLR types for SQL Server 2014
重新启动后,再次连接到Web服务/您的应用,并确认错误已解决。
或者您不能遵循此link来阅读更多内容。
答案 4 :(得分:0)
首先为Ms SQL 2014安装SQLSysClrTypes,然后为ms sql 2014安装ReportViewer
重新启动您的应用程序或项目,在我的情况下已解决。
答案 5 :(得分:0)
在IIS Server PC上部署后出现此错误。
https://www.microsoft.com/en-us/download/details.aspx?id=42295 enter link description here
https://www.microsoft.com/en-us/download/details.aspx?id=45496
可能需要重新启动计算机。
答案 6 :(得分:0)
此处是指向Webreports版本12的链接 https://www.nuget.org/packages/Microsoft.ReportViewer.WebForms.v12/12.0.0?_src=template
安装软件包后
在工具箱上,浏览dll并将其引用到bin,然后运行visual studio