asp.net-mvcasp.net-corepdf-generationrdlc.net-8.0

vbc.exe Missing While Using RDLC in ASP.NET Core MVC 8.0


We want to download a PDF file using RDLC Report Designer and use expressions in the footer section to use the Page Number options, but while running the file, the below error is coming, and when we try to find the v8.0.14 folder in the above directory, there is nothing about it. Old Suggestion said that "just copied vbc.exe from 4.0 to 8.0.0" but there is no 8.0.0 (dotnet) folder in the directory.

An unhandled exception occurred while processing the request.

InvalidOperationException: Compiler executable file C:\WINDOWS\Microsoft.NET\Framework64\v8.0.14\vbc.exe cannot be found.

AspNetCore.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, out string description, out string language, out ParameterInfoCollection parameters, out DataSourceInfoCollection dataSources, out DataSetInfoCollection sharedDataSetReferences, out UserLocationFlags userReferenceLocation, out ArrayList dataSetsName, out bool hasExternalImages, out bool hasHyperlinks, out byte[] dataSetsHash)

ReportProcessingException: An unexpected error occurred in Report Processing. Compiler executable file C:\WINDOWS\Microsoft.NET\Framework64\v8.0.14\vbc.exe cannot be found.

Even ChatGPT is not answering properly, stuck in a loop!


Solution

  • Please copy v4.0.30319 and paste here, then rename it v8.0.x, for me, the error message is 8.0.0, you can check it like below.

    Why we facing this issue, because it's asp.net core application, and it try to find the vbc.exe inside the v8.0.0.

    enter image description here


    As far as I know, the above workaround is the best answer so far.

    Why we face this issue?

    Because you are using RDLC report in asp.net core application. As we know, RDLC us used for .NET Framework, not .NET Core. And from the error message, we found vbc.exe is needed.

    And we also use No Managed Code for asp.net core web application.

    enter image description here

    Tip

    If your project is only deployed in Windows IIS, you can use the above workaround. If you plan to migrate to the Linux platform, it is recommended to use other reports libraries(RDLC IS NOT RECOMMENDED).