System.ArgumentNullException:值不能为null。 Paramete

时间:2015-05-16 06:02:11

标签: asp.net-mvc stimulsoft

iam使用mvc5.2和stimulsoft 2014.3运行时看到错误: 描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪,以获取有关错误及其在代码中的起源位置的更多信息。

异常详细信息:System.ArgumentNullException:值不能为null。 参数名称:key

  

来源错误:

     

第7行:第8行:
  @ Html.Stimulsoft()。RenderMvcViewerScripts()第9行:
  @ Html.Stimulsoft()。StiMvcViewer(“MyViewr”,新的StiMvcViewerOptions()   第10行:{第11行:ActionGetReportSnapshot =   “FromLoadFileReport”,

    @Html.Stimulsoft().StiMvcViewer("MyViewr", new StiMvcViewerOptions()
  {
      ActionGetReportSnapshot = "FromLoadFileReport",
      ActionViewerEvent = "ViewerEvent",
      Width = Unit.Percentage(100)
      //Theme = StiTheme.Office2007Black,
      //ActionPrintReport = "PrintReport",
      //ActionExportReport = "ExportReport",
      //ToolbarBackgroundColor = System.Drawing.Color.Silver



  StiReport report = new StiReport();
        string Path = Server.MapPath("~" + ("/Web/Areas/RepUser/HistoryJob.mrt"));
        report.Load(Path);
        report.Compile();

        return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);

show this error

1 个答案:

答案 0 :(得分:1)

您应该在Web.config文件中添加下一部分:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.1" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>