Microsoft.ReportViewer.ProcessingObjectModel failed to load

Dave Anderson 6 Reputation points
2022-04-01T22:17:13.61+00:00

Nuget
Microsoft.ReportingServices.ReportViewerControl.WebForms Version: 150.1484.0

Web config

            <assemblies>
                <!-- All assemblies updated to version 15.0.0.0. -->
                <add assembly="Microsoft.ReportViewer.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                <add assembly="Microsoft.ReportViewer.DataVisualization, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                <add assembly="Microsoft.ReportViewer.Design, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                <add assembly="Microsoft.ReportViewer.WebDesign, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                <add assembly="Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                <add assembly="Microsoft.ReportViewer.WinForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
            </assemblies>

Use case

        ReportViewer viewer = new ReportViewer();
        viewer.ProcessingMode = ProcessingMode.Local;
        viewer.LocalReport.ReportEmbeddedResource = "MyReport.rdlc";
        ReportDataSource rds = new ReportDataSource("MyDataSource", mytransactions);
        viewer.LocalReport.SetParameters(new ReportParameter[] { p1 });
        viewer.LocalReport.DataSources.Add(rds);
        viewer.LocalReport.EnableHyperlinks = true;

        byte[] bytes = null;
        try
        {
            if (reportType == "pdf") bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
            if (reportType == "excel") bytes = viewer.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
        }
        catch (Exception ex)
        {
            Trace.WriteLine("ERROR: In Report " + ex.Message);
        }

Exception when rendering is:

Failed to load expression host assembly. Details: Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))

Correct DLLs are in the Bin directory of the project.

Using .Net Framework 4.8
Visual Studio 2022 v17.1.1

Spent the day trying solutions. Emptied the Nuget cache, checked the GAC, restarted Visual Studio several times, cleaned and rebuilt the project several times.

I am at a loss. Meanwhile customer are yelling.

Any other ideas?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
Developer technologies Visual Studio Other
{count} votes

1 answer

Sort by: Most helpful
  1. Dave Anderson 6 Reputation points
    2022-04-05T16:46:19.72+00:00

    Ok found the issue. Even thought the project compiles in VS2022 and runs, it needs additional components added to VS in order to actually work for the Render.

    I don't know exactly which the package I added to the installer added to make it work.

    How do we close this?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.