【问题标题】:The given key was not present in the dictionary - Visual studio SSDT Deploy字典中不存在给定的键 - Visual Studio SSDT Deploy
【发布时间】:2018-04-14 03:22:40
【问题描述】:

我在 Visual Studio 2017 中有一个 SSDT 项目,并且有多个报告使用共享数据源。我可以构建所有报告,也可以通过刷新数据的能力预览它们。但是,当我单击部署时,我会收到错误消息

错误:给定的键不在字典中。

我检查了项目部署详细信息,例如(目标服务器详细信息、目标报告文件夹等),它们都是正确的。谁能建议调试此错误的最佳方法? Visual Studio Error Deployment Settings

【问题讨论】:

  • 能否附上您填写的详细信息和错误信息的图片?
  • 我在问题中添加了链接。
  • 我把你的和我的交叉核对了,看起来还不错Have a look at this
  • 谢谢,但如下所示,我在预览报告或刷新数据源方面没有任何问题。部署到报表服务器时出现错误。

标签: reporting-services visual-studio-2017 sql-server-data-tools


【解决方案1】:

我在使用 VS2017 15.3.5 中的扩展和更新安装的 Microsoft Reporting Services 1.17 时遇到了完全相同的问题。我使用 Visual Studio 进行调试并使用 JetBrains dotPeek 进行反编译,这指向 Microsoft.ReportingServices.BuildProcess.dll 中的错误。正在通过字典中的 URL 查找连接属性。据我所知,这本字典永远不会被填充。 解决方案是卸载扩展并安装SSDT for Visual Studio 2017 (15.3.0 preview)

【讨论】:

    【解决方案2】:

    感谢大家的反馈。我发现了这个错误,并将在下一版本的 Reporting Services VSIX 中发布修复程序。

    谢谢, 马特

    【讨论】:

    • 是否可以在某处下载带有此修复程序的某种 VSIX Beta 版本?
    • 您好 Daan - 一旦我获得了此版本的发布版本,我将与管理层合作更新 Reporting Services VSIX。
    【解决方案3】:

    在您的 .rdl 文件旁边的报告项目目录中有一个 .rdl.data 文件。如果您关闭报表设计器,删除该文件,然后再次尝试预览,希望对您有所帮助。

    【讨论】:

    • 谢谢,但是我遇到问题的不是预览,它工作正常。部署报告时发生错误。
    【解决方案4】:

    我遇到了同样的问题。问题是,当我部署报告并尝试通过 URL 访问它时没有问题,但是当我尝试以编程方式访问时,浏览器会启动此错误“字典中不存在给定的密钥”。我调查并发现我没有在代码上将可见性标志设置为“假”。

    https://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.reportparameter.aspx

    ReportParameter(String, String, Boolean)
    使用名称、值和可见性标志实例化一个新的 ReportParameter。

    最后,我的代码是这样的:

                this.rptViewer.Reset();
    
                rptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                MyReportServerCredentials credencial = new MyReportServerCredentials();
                rptViewer.ServerReport.ReportServerCredentials = credencial;
    
                this.rptViewer.ServerReport.ReportServerUrl = new System.Uri(this.ReportServerUrl);
                this.rptViewer.ServerReport.ReportPath = ReportUrl;
    
                this.rptViewer.ServerReport.ReportServerUrl = new System.Uri(this.ReportServerUrl);
                this.rptViewer.ServerReport.ReportPath = ReportUrl;
    
                ReportParameter p1 = new ReportParameter("param1", new string[] { null }, false);
                ReportParameter p2 = new ReportParameter("param2", new string[] { null }, false);
                ReportParameter p3 = new ReportParameter("param3", new string[] { null }, false);
                ReportParameter p4 = new ReportParameter("param4", new string[] { null }, false);
    
    
                this.rptViewer.ServerReport.SetParameters(new ReportParameter[] { p1, p2, p3, p4 });
    
                this.rptViewer.AsyncRendering = false;
                this.rptViewer.SizeToReportContent = true;
                this.rptViewer.ServerReport.Refresh();
    

    希望对你有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-18
      • 2016-08-14
      • 2022-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多