RDLC reports on .NET Core 8

Marco 20 Reputation points
2024-04-15T08:50:57.27+00:00

Hi at all,

I'm using a rdlc report inside a .net core 8 app but i'm getting this error

{"An error occurred during local report processing.;The definition of the report 'report path inside the project' is invalid.\r\nAn unexpected error occurred in Report Processing.\r\nCompiler executable file C:\WINDOWS\Microsoft.NET\Framework64\v8.0.2\vbc.exe cannot be found."}

It only work if i copy the vbc.exe from another .net framework version, but if i deployed the app in azure i can't do this. It's possible to solve this problem without the copy of vbc.exe(Visual Basic Command Line Compiler)?

Thanks

Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Other
{count} votes

1 answer

Sort by: Most helpful
  1. AinhoaGiles 220 Reputation points
    2024-12-21T11:31:37.75+00:00

    This error happens because RDLC reports rely on Visual Basic for expressions, and .NET 8 does not include vbc.exe by default. Here's how to fix it without manually copying files:

    Solution 1: Install .NET SDK with Visual Basic Support

    1. Open Visual Studio Installer.
    2. Modify your .NET 8 installation.
    3. Under Individual Components, search for .NET Framework 4.x targeting pack and .NET Framework SDK.
    4. Install them and restart your development environment.

    Solution 2: Use Microsoft.ReportingServices.ReportViewer

    • Switch to the ReportViewer control for RDLC processing.
    • Install the Microsoft.ReportingServices.ReportViewer.NetCore NuGet package.
    • This uses managed code and doesn't rely on vbc.exe.

    Solution 3: Use .NET 6/7

    • RDLC reports work more smoothly in .NET 6 or 7 because of better backward compatibility with .NET Framework dependencies.
    • Consider downgrading to .NET 7 if possible.

    Azure Deployment

    For Azure:

    • Use App Service with .NET Framework runtime for compatibility.
    • Alternatively, containerize the app with all dependencies pre-installed.

    Let me know if you need help implementing any of these steps! This error happens because RDLC reports rely on Visual Basic for expressions, and .NET 8 does not include vbc.exe by default. Here's how to fix it without manually copying files:

    Solution 1: Install .NET SDK with Visual Basic Support

    1. Open Visual Studio Installer.
    2. Modify your .NET 8 installation.
    3. Under Individual Components, search for .NET Framework 4.x targeting pack and .NET Framework SDK.
    4. Install them and restart your development environment.

    Solution 2: Use Microsoft.ReportingServices.ReportViewer

    • Switch to the ReportViewer control for RDLC processing.
    • Install the Microsoft.ReportingServices.ReportViewer.NetCore NuGet package.
    • This uses managed code and doesn't rely on vbc.exe.

    Solution 3: Use .NET 6/7

    • RDLC reports work more smoothly in .NET 6 or 7 because of better backward compatibility with .NET Framework dependencies.
    • Consider downgrading to .NET 7 if possible.

    Azure Deployment

    For Azure:

    • Use App Service with .NET Framework runtime for compatibility.
    • Alternatively, containerize the app with all dependencies pre-installed.

    Let me know if you need help implementing any of these steps!


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.