I am getting a blank page while deploying MVC application on IIS

后端 未结 13 1364
一生所求
一生所求 2020-12-06 00:27

I am currently deploying my application built using RC of MVC ASP.NET on the production server which is showing nothing now. The routes in my global.ascx are typical i.e. <

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 01:08

    This was also happening to me when:

    1) I added a CompressAttribute to add Gzip when the browser accepts it.

    response.AppendHeader("Content-Encoding", "gzip");
                        response.Filter = new GZipStream(response.Filter, CompressionMode.Compress);
    

    2) I was modifying the output HTML to change the displayed phone number:

    response.Filter = new OutputHtmlReplacer(response.Filter, phoneNumber);
    

    where OutputHtmlReplacer is a class that inherits from MemoryStream

    So, the solution was:

    1) Verify the headers and check if we are applying compression.

    2) If so, then the new OutputHtmlReplacer response filter has to be wrapped by the GzipStream.

提交回复
热议问题