Search code examples
c#.netwindows-10visual-studio-2022rdlc

FatalExecutionEngineError when trying to render a simple RDLC file


I'm trying to implement a report generator for a work project, I did make it work at a point but I can't anymore, unfortunately I can't figure what made the problem appear. Even doing the simplest RDLC file doesn't work anymore if it contains at least a single placeholder.

I'm using Windows 10, with Visual Studio 2022. The CLR version showing in the Output is CLR v4.0.30319

What I tried to do is :

  • Update .NET to last version
  • Install a lot of .NET Framework in the visual studio installer
  • Begin a new project and step by step trying to make it work But all with no success.

Here are the errors I get when launching the app :

Error encountered when launching report, 1 Error encountered when launching report, 2

Here are the steps I'm following when trying to implement my project :

  • Create a .NET Framework 4.7.2 windows app
  • In the Nuget Package Manager, install Microsoft.ReportingServices.ReportViewerControl.Winforms (I tried version 150.1620.0 & 150.1586.0)
  • It asks to also install Microsoft.SqlServer.Types, which I accept
  • I add a reportViewer control into my form, which I dock
  • I create a new .RDLC file by right clicking on the project > Add > New Item > Report
  • I set my page size & interactive size for my report to 21cm, 29.7cm
  • I also set the RDLC page size to it
  • I add to the top left a textbox containing the current date with a placeholder containing the date
  • On the reportViewer on the form, I select my rdlc file
  • I launch the app
  • It gives the errors I showed earlier

Now if I remove the placeholder containing the date : [Image that shows that it works without any placeholder] (https://i.sstatic.net/ErLLo.png)

Do you guys have already got this kind of error ? How do you fix that ? I had a completely working project a couple months ago but now even the simplest page fails.

Also what I find weird is that even tho it asked me to install the dependency, it doesn't appear in the Nuget Package Manager, but it detects it in the console because I have a warning saying : NU1603: Microsoft.ReportingServices.ReportViewerControl.Winforms 150.1586.0 depends on Microsoft.SqlServer.Types (>= 14.0.0) but Microsoft.SqlServer.Types 14.0.0 was not found. An approximate best match of Microsoft.SqlServer.Types 14.0.314.76 was resolved.

Seeing this, I tried adding a PackageReference for the SqlServer.Types into the csproj file of my project : Csproj containing PackageReference

And after doing so it appears in the Nuget Package Manager and in the references of my project, but it still doesn't work, even tho the warning doesn't show anymore.

For more precision, I tried using a parameter for my placeholder, built-in fields or even a simple text (with quotes obviously) but no luck.

Any help would be appreciated, thank you by advance.


Solution

  • From what I read from the posts on the post you forwarded, the problem might be due to a McAfee/Trellix update, which I had recently. I will try to contact my IT team to disable it to test, I will come back to confirm if that was the cause, which I think it is, as it caused other problems in our dev team.

    Update: It was indeed Trellix that was the cause of the problem, from what I've seen the error can be seen with .NET applications running in 32 bits, my IT Team had to add a policy to disable scanning Advanced Scripting.

    https://kcm.trellix.com/corporate/index?page=content&id=SB10405