500 - Internal Server Error
When loading a report on browser an error 500 - Internal Server Error is displayed in deployment environment, but working properly in development environment. I am using IIS 10, ASP.NET Core 3.1. Failed to load resource: the server responded with a status of 500 (Internal Server Error). I have tried to remove the reports folder in wwwroot and the error is still the same. The error is inside the report. WebReport.Report.Load("wwwroot/Reports/" + "report1.frx"); is my reference to the report. I am using Fastreport opensource
This discussion has been closed.
Comments
https://mariusschulz.com/blog/getting-the-web-root-path-and-the-content-root-path-in-asp-net-core
Hi ipong,
Thank you for your quick response. However am still facing the same problem.
string frx = Path.Combine(_env.WebRootPath, "Reports", "report1.frx");
WebReport.Report.Load(frx);
WebReport.Report.Dictionary.Connections[0].ConnectionString = connString;
WebReport.Report.Prepare();
ViewBag.WebReport = WebReport;
Your assistance is greatly appreciated
try catch will help you, https://forum.fast-report.com/en/uploads/636/9BS8RMROLGRJ.zip
i have added my code, since i am using asp.net core and a viewbag. I am not sure of how to use FastReportHtml function, as it seems a class is passed to cshtml from your code.
Hello!
During publication (Publish), the folder containing the .frx reports has not been copied to the output directory, or a relative path is being used instead of IWebHostEnvironment.WebRootPath / ContentRootPath.
The IIS application pool (Application Pool Identity) does not have write permissions to the temporary folder (Config.TempFolder) or the fonts folder, or an unsuitable pool has been configured (for Core in InProcess mode, it is important to set .NET CLR version to ‘No Managed Code’).