Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WinForms ReportViewer在.NET 4.0中是否具有其他部署依赖项?_Winforms_Deployment_.net 4.0_Reportviewer - Fatal编程技术网

WinForms ReportViewer在.NET 4.0中是否具有其他部署依赖项?

WinForms ReportViewer在.NET 4.0中是否具有其他部署依赖项?,winforms,deployment,.net-4.0,reportviewer,Winforms,Deployment,.net 4.0,Reportviewer,我最近将一个WinForms应用程序从.NET 3.5更新为.NET 4.0,其中包含本地报告。我将Microsoft.ReportViewer.WinForms、Microsoft.ReportViewer.Common和Microsoft.ReportViewer.ProcessingObjectModel的11.0版程序集包括在应用程序目录中,这是使用.NET 3.5部署此应用程序所需的全部工作,但我在使用.NET 4.0但没有VisualStudio或SQL Server的目标计算机上遇

我最近将一个WinForms应用程序从.NET 3.5更新为.NET 4.0,其中包含本地报告。我将Microsoft.ReportViewer.WinForms、Microsoft.ReportViewer.Common和Microsoft.ReportViewer.ProcessingObjectModel的11.0版程序集包括在应用程序目录中,这是使用.NET 3.5部署此应用程序所需的全部工作,但我在使用.NET 4.0但没有VisualStudio或SQL Server的目标计算机上遇到以下错误:

TYPE: Microsoft.Reporting.WinForms.LocalProcessingException
MSG: An error occurred during local report processing.
SOURCE: Microsoft.ReportViewer.WinForms
SITE: EnsureExecutionSession
   at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
   at Microsoft.Reporting.WinForms.LocalReport.SetParameters(IEnumerable`1 parameters)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer._SetReportParameters(String departmentName, String footer)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer._RefreshReport(DataTable sourceTable, String sourceName, String reportResourceName, String departmentName, String footer)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer.ShowMissingReport(MissingFilesDataTable missingTable, String departmentName, String footer)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.DocumentIntegrityForm._HandleMissingComplete(Object sender, RunWorkerCompletedEventArgs e)

-- INNER EXCEPTION --
TYPE: Microsoft.Reporting.DefinitionInvalidException
MSG: The definition of the report '' is invalid.
SOURCE: Microsoft.ReportViewer.Common
SITE: CompileReport
   at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
   at Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
   at Microsoft.Reporting.LocalService.CompileReport()
   at Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
   at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()

-- INNER EXCEPTION --
TYPE: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
MSG: An unexpected error occurred in Report Processing.
SOURCE: Microsoft.ReportViewer.Common
SITE: CreateIntermediateFormat
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
   at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)

-- INNER EXCEPTION --
TYPE: System.IO.FileNotFoundException
MSG: Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
SOURCE: Microsoft.ReportViewer.Common
SITE: Write
FILE: Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
   at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(Object obj, Boolean verify, Boolean assertOnInvalidType)
   at Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Serialize(IntermediateFormatWriter writer)
   at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(IPersistable persistableObj, Boolean verify)
   at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.WriteVariantOrPersistable(Object obj)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateHashForCachedDataSets()
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateIntermediateFormat(Byte[] definition, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, IDataProtection dataProtection, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)

我尝试运行,但它也抱怨
Microsoft.SqlServer.Types
。我不明白为什么我有这种新的依赖,即使这是一个本地报告。该代码不使用任何高级数据类型,也不使用任何超出.NET 3.5版本所使用的数据类型,该版本只需要这三个
Microsoft.ReportViewer.*
程序集。有人能给我一个有限的列表,列出使用Report Viewer部署.NET 4.0应用程序的要求吗?

您为Report Viewer 2012可再发行版提供的链接在最底部有一些信息

补充资料

Microsoft SQL Server 2008 Reporting Services或更高版本是服务器处理模式的先决条件。NET Framework 3.5 SP1或.NET Framework 4.0 SQL Server系统CLR类型包

看起来您缺少SQL Server系统CLR类型包。它可以从SQL Server功能包下载-这里是指向该功能包最新安装程序列表的链接

您将看到多个列表,具体取决于x86等


希望这会有所帮助。

此错误的主要原因是项目或安装文件无法访问报表查看器dll,因此请手动添加与报表查看器相关的以下所有dll文件

  • Microsoft.ReportViewer.Common
  • Microsoft.ReportViewer.ProcessingObject模型
  • Microsoft.ReportViewer.WinForms
  • Microsoft.ReportViewer.DataVisualization

  • 现在,我希望此错误能够轻松解决。

    在Manage NuGet软件包中添加:

  • Microsoft.ReportViewer.Window

  • 但是我仍然不明白为什么我需要本地报表的“服务器处理模式”,或者,就这一点而言,“服务器处理模式”是什么。下面是包的描述:Microsoft®System CLR Types for SQL server®2008 R2 SQL server System CLR Types包包含实现几何、地理、,和SQL Server 2008 R2中的层次结构id类型。此组件可以与服务器分开安装,以允许客户端应用程序在服务器之外使用这些类型。因此,您必须在报告中使用这些类型中的一种,因此无论是服务器还是本地,这都是必需的,因为答案是“是”,所以我将此标记为答案。尽管如此,我没有对报告做任何不需要在.NET3.5中使用“这些类型”的更改。您是否在VS中升级了一个版本?在从vs2010迁移到vs2013的过程中,我做了同样的事情,结果我需要的是2010年的运行时程序集,而不是12个…我花了一点时间才弄明白。。。