且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

System.ArgumentNullException:值不能为空。 Paramete

更新时间:2022-10-14 23:17:49

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

 <&运行GT;
    < assemblyBinding的xmlns =瓮:架构 - 微软COM:asm.v1>
      < dependentAssembly>
        < assemblyIdentity名称=System.Web.Mvc公钥=31bf3856ad364e35/>
        < bindingRedirect oldVersion =1.0.0.0-2.0.0.0NEWVERSION =3.0.0.1/>
      < / dependentAssembly>
    < / assemblyBinding>
  < /运行>

iam use mvc5.2 and stimulsoft 2014.3 when run this see error: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key

Source Error:

Line 7: Line 8:
@Html.Stimulsoft().RenderMvcViewerScripts() Line 9:
@Html.Stimulsoft().StiMvcViewer("MyViewr", new StiMvcViewerOptions() Line 10: { Line 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);

You should add next section in Web.config file:

  <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>