Page 1 of 1

Value cannot be null. Parameter name: key

Posted: Tue Mar 08, 2016 12:08 pm
by salmasi
hello
i use stimulsoft 2014.3.0.0 in mvc 4 ,win 10,visual studio 2015 and below references copy local in bin folder
Stimulsoft.Base
Stimulsoft.Report
Stimulsoft.Report.Mvc
Stimulsoft.Report.Web

and assmblies part in web.config

Code: Select all

    <compilation debug="true" targetFramework="4.0">
    <assemblies>
      <add assembly="Stimulsoft.Base, Version=2014.3.0.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a" />
      <add assembly="Stimulsoft.Report, Version=2014.3.0.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a" />
      <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </assemblies>
    </compilation>
binding redirect part in web.config

Code: Select all

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers"
             publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor"
            publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc"
             publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages"
             publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
in view using part

Code: Select all

@using Stimulsoft.Report.Mvc;
in view script render part

Code: Select all

@Html.Stimulsoft().RenderMvcViewerScripts()
in using viewer part

Code: Select all

    @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
    ActionGetReportSnapshot = "GetReportSnapshot",
    ActionViewerEvent = "ViewerEvent",
    ActionPrintReport = "PrintReport",
    ActionExportReport = "ExportReport",
    RightToLeft = true
})
i get in local running "Value cannot be null. Parameter name: key" error
but when upload to server with win server 2008r2 OS it run perfect
please help me.

Re: Value cannot be null. Parameter name: key

Posted: Tue Mar 08, 2016 10:18 pm
by salmasi
i update stimulsoft to version 2016.1.0.0 trial and test it
but i get following error

Code: Select all

Server Error in '/' Application.

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

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.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error: 


Line 29: </div>
Line 30: <div>
Line 31:     @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
Line 32: {
Line 33:     ActionGetReportSnapshot = "GetReportSnapshot",

Source File: d:\Backups\Farano.EducationSystem\Registeration\Views\Attendance\Report.cshtml    Line: 31 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///D:/Backups/Farano.EducationSystem/Registeration/
LOG: Initial PrivatePath = D:\Backups\Farano.EducationSystem\Registeration\bin
Calling assembly : Stimulsoft.Report.Mvc, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Backups\Farano.EducationSystem\Registeration\web.config
LOG: Using host configuration file: C:\Users\ali\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: The same bind was seen before, and was failed with hr = 0x80131040.

Stack Trace: 


[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   ASP._Page_Views_Attendance_Report_cshtml.Execute() in d:\Backups\Farano.EducationSystem\Registeration\Views\Attendance\Report.cshtml:31
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +125
   System.Web.WebPages.StartPage.RunPage() +17
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +64
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +245
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +22
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +176
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +88
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +42
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +16
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +51
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +16
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +41
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +16
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +43
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +576
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.79.0
i think last version of mvc that stimulsoft support in my pc is mvc 3.0.0.1
but when publish to web server every thing ok and work with mvc 4.0
some thing wrong in my pc??? :o

Re: Value cannot be null. Parameter name: key

Posted: Wed Mar 09, 2016 9:08 am
by HighAley
Hello.

Please, check your Web.config file. There should be dependentAssembly section with next settings:

Code: Select all

      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
      </dependentAssembly>
Thank you.

Re: Value cannot be null. Parameter name: key

Posted: Thu Mar 10, 2016 12:21 pm
by salmasi
thanks for answer
but my project target framework is 4.0
but MVC 5.2.3.0 require framework 4.5 and can not install with .net framework 4.0
is any version of stimulsoft that work with .net framework 4.0 and mvc 4.0?

Re: Value cannot be null. Parameter name: key

Posted: Thu Mar 10, 2016 2:00 pm
by HighAley
Hello.

Please, correct the bindingRedirect to the version that you use.

Thank you.

Re: Value cannot be null. Parameter name: key

Posted: Fri Mar 11, 2016 7:13 am
by salmasi
hello
if look at my web.config part above, i have MVC redirect binding to mvc 4.0
thanks a lot

Re: Value cannot be null. Parameter name: key

Posted: Fri Mar 11, 2016 12:37 pm
by HighAley
Hello.

We are always glad to help you.

Thank you.

Re: Value cannot be null. Parameter name: key

Posted: Fri Mar 11, 2016 9:03 pm
by salmasi
thanks your help, but problem not solved yet

Re: Value cannot be null. Parameter name: key

Posted: Sat Mar 12, 2016 9:03 pm
by salmasi
no any one can help my problem :roll: :|

Re: Value cannot be null. Parameter name: key

Posted: Mon Mar 14, 2016 6:42 am
by HighAley
Hello.

Please, send us your project for analysis.

Thank you.