Episerver page working on local but not on Production


I have a page controller having two actions. One is index and one is download like below

        public async Task Index(ReportPage currentPage, string id)
            /* Implementation of action. You can create your own view model class that you pass to the view or
             * you can pass the page type for simpler templates */

            // todo: check if the report id is valid

            Report report = null;
            ReportPageViewModel model = null;

            if (String.IsNullOrEmpty(id))
                model = new ReportPageViewModel(currentPage, report);
                return View(model);

            report = await RystadGlobal.api.GetReport(Authentication.GetTokenTypeFromCookie(), Authentication.GetTokenFromCookie(), int.Parse(id));

            model = new ReportPageViewModel(currentPage, report);
            return View(model);
        public async Task Download(ReportPage currentPage, string id)
                Report report = await RystadGlobal.api.GetReport(Authentication.GetTokenTypeFromCookie(), Authentication.GetTokenFromCookie(), int.Parse(id));

                string ext = Path.GetExtension(report.fileName);

                byte[] byteArray = await RystadGlobal.api.DownloadReport(RystadIdentity.Current.AuthenticatedUser.TokenType, RystadIdentity.Current.AuthenticatedUser.Token, report.Id);

                var name = RystadIdentity.Current.AuthenticatedUser.UserInfo.name;

                if (ext.ToLower() == ".pdf")
                    byteArray = PdfWatermarker.Watermark(byteArray, name);

                return File(byteArray, System.Net.Mime.MediaTypeNames.Application.Octet, report.fileName);

            catch (Exception e)
                throw new Exception("Something went wrong when downloading file.");


The issue is the Download action is working on localhost like


but the same thing is not working on production


When I hit thsat page I get

Page could not be loaded

The link you specified does not work. This may either be the result of temporary maintenance or an incorrect link.

Any pointers?

Jan 04, 2018 7:33

Try removing the try catch statement and then check your log file.

Jan 04, 2018 9:42

Looks like there is some error, please make sure that you can see runtime errors. So, change settings in web.config file to see errors and remove try catch block as mentioned by Oskar.

Jan 04, 2018 9:46

If you're on the DXC rather than changing the log files you should get Episerver to turn on Error logging and then use the PASS portal to see the web server errors streamed from the production server. This would be better than changing the web.config and even if you change the web.config sometimes the Azure config will stop you seeing application errors on the DXC in my expereince.

Jan 04, 2018 10:21

You can also have a look into New relic application. It shows application and environment errors which sometimes are not captured in application logs in detailed.

Jun 07, 2018 8:20

Yes although it's worth nothing this is moving to application insights now for any new clients but the same principle applies

Jul 10, 2018 17:36
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.