SSRS Error System.InvalidOperationException: Operation is not valid due to the current state of the object.

SSRS 2005 running on Windows Server 2008 R2 had the following errors as reported on SSRS Logs:-

System.InvalidOperationException: Operation is not valid due to the current state of the object.

Seems to possible causes:-

Installation of Security Update for Microsoft .Net Framework 4 on Servers (KB2656351) and also having large number of parameters or form fields in a SSRS report.

Fix

Open Web.Config for ReportManager usual at:-

C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager 

Find <appsettings> in the file and add 2 new keys:-

<add key="aspnet:MaxHttpCollectionKeys" value="10000" />

<add key="aspnet:MaxJsonDeserializerMembers" value="10000" />

So you should see something like:-

<appSettings>

    <add key="ReportViewerServerConnection" value="Microsoft.ReportingServices.UI.WebControlConnection, ReportingServicesWebUserInterface, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <add key="ReportViewerTemporaryStorage" value="Microsoft.ReportingServices.UI.ReportViewerTemporaryStorage, ReportingServicesWebUserInterface, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <add key="aspnet:MaxHttpCollectionKeys" value="10000" />

    <add key="aspnet:MaxJsonDeserializerMembers" value="10000" />

</appSettings>

Also I recommend changing the Web.Config for ReportServer usual at:-

C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

In this file there is usual no <appsetting> already added so just pop one under the </ConfigSections> part:-

</configSections>

<appSettings>

<add key="aspnet:MaxHttpCollectionKeys" value="10000" />

<add key="aspnet:MaxJsonDeserializerMembers" value="10000" />

</appSettings>

No need to re-start SSRS or IIS, it should just now be fixed.

Comments are closed