0
votes

I developed a c# Web Application with Visual Studio

.NET Framework 4.5.2

This application reads an rpt file, set dataset and save exported pdf in a folder.

Debugging my program locally works perfectly (I installed the Crystal Report for Visual Studio)

Publishing my application and putting it on my server (Windows Server 2019) I get the "The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception" Exception.

I tryied do download the Runtime from this page

I tryied to publish the application in 64bit CPU

In my application property I have these references: enter image description here

but i get the same error. I have no idea what I have to do now.

Can you help me?

1
did you install the runtime on the server? if so, which version? - jcruz

1 Answers

1
votes

I am not sure if you still looking for this,
But I would like to suggest (even though its an old enough question)

put crystalreportviewers13 folder with your published project as well your IIS path
(i.e. - in my PC its - C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319).

If this does not help your scenario, let me know.

1) You have to put folder in your published app folder.
i.e. my published website/webapp is named : Inventory, than,
path for crystalreportviewers13 folder is :
Folder Path
where 4_0_30319 is dotnet framework version.