简体   繁体   中英

Getting blank page after deploying ASP.NET MVC application on IIS

I have deployed an ASP.NET MVC application on my windows 10 system IIS. I have given full permission to IIS_IUSRS of both the root folder and web.config file. ie

在此处输入图像描述

My web.config is:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
      <add key="webpages:Version" value="3.0.0.0" />
      <add key="webpages:Enabled" value="false" />
      <add key="ClientValidationEnabled" value="true" />
      <add key="UnobtrusiveJavaScriptEnabled" value="true" />
      <add key="ApiBaseUrl" value="http://localhost:61681/api/" />
  </appSettings>
  <system.web>
      <compilation targetFramework="4.6.1" />
      <httpRuntime targetFramework="4.6.1" />
      <pages>
          <namespaces>
              <add namespace="Online.Common.Admin" />
          </namespaces>
      </pages>
  </system.web>
  <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
              <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
              <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
          </dependentAssembly>
          <dependentAssembly>
              <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
              <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
              <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
              <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
          </dependentAssembly>
          <dependentAssembly>
              <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
              <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
          </dependentAssembly>
          <dependentAssembly>
              <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
              <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
              <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
              <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
              <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
              <bindingRedirect oldVersion="1.0.0.0-5.2.4.0" newVersion="5.2.4.0" />
          </dependentAssembly>
      </assemblyBinding>
  </runtime>
  <system.codedom>
      <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" type="microsoft.codedom.providers.dotnetcompilerplatform.csharpcodeprovider, microsoft.codedom.providers.dotnetcompilerplatform, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" warninglevel="4" compileroptions="/langversion:default /nowarn:1659;1699;1701" />
          <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="microsoft.codedom.providers.dotnetcompilerplatform.vbcodeprovider, microsoft.codedom.providers.dotnetcompilerplatform, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" warninglevel="4" compileroptions="/langversion:default /nowarn:41008 /define:_mytype=\&quot;web\&quot; /optioninfer+" />
      </compilers>
  </system.codedom>
</configuration>
<!--ProjectGuid: E2BBCD58-DEC6-4A53-9CFE-FCFA11E6EBDB-->

Application in my IIS is like:

在此处输入图像描述

But when i go to http://localhost/test123123 i get a blank page. What can be the issue, i am stuck on it for 5 hours now.

In logs i have this:

#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-07-04 18:16:33
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2020-07-04 18:16:33 192.168.10.8 GET /bmlinks/ddf.xml - 80 - 192.168.10.8 avast!+Antivirus - 404 0 64 11900
2020-07-04 18:16:33 192.168.10.8 GET /upnp/BasicDevice.xml - 80 - 192.168.10.8 avast!+Antivirus - 404 0 64 9898
2020-07-04 18:16:34 192.168.10.8 GET / - 80 - 192.168.10.8 avast!+Antivirus - 200 0 64 29749
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-07-04 18:39:05
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2020-07-04 18:39:05 ::1 GET / - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/83.0.4103.116+Safari/537.36 - 200 0 0 3613
2020-07-04 18:39:05 ::1 GET /iisstart.png - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/83.0.4103.116+Safari/537.36 http://localhost/ 200 0 0 43
2020-07-04 18:39:05 ::1 GET /favicon.ico - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/83.0.4103.116+Safari/537.36 http://localhost/ 404 0 2 4
2020-07-04 18:47:30 ::1 GET /test123123 - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/70.0.3538.102+Safari/537.36+Edge/18.18362 - 500 19 5 87
2020-07-04 18:51:51 ::1 GET /test123123 - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/70.0.3538.102+Safari/537.36+Edge/18.18362 - 500 19 5 1

Browser console is:

在此处输入图像描述

you are getting the error 500.19 which is a configuration error. it means there is something wrong with your web.config file.

you could try to remove below code from your web.config file:

    <system.codedom>
      <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" type="microsoft.codedom.providers.dotnetcompilerplatform.csharpcodeprovider, microsoft.codedom.providers.dotnetcompilerplatform, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" warninglevel="4" compileroptions="/langversion:default /nowarn:1659;1699;1701" />
          <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="microsoft.codedom.providers.dotnetcompilerplatform.vbcodeprovider, microsoft.codedom.providers.dotnetcompilerplatform, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" warninglevel="4" compileroptions="/langversion:default /nowarn:41008 /define:_mytype=\&quot;web\&quot; /optioninfer+" />
      </compilers>
  </system.codedom>

if you still face and issue enable detailed error in iis for your site.

  1. Open the IIS console on the webserver machine.

  2. Double-click the Error Pages option:

在此处输入图像描述

  1. Select the Edit Feature Settings... option:

在此处输入图像描述

  1. Change the default setting from the third option, Detailed errors for local requests and custom error pages for remote requests to the second option, Detailed errors:

在此处输入图像描述

5)restart iis.

Can u try adding network service user account to the Identity of DefaultWebSite AppPool in IIS. And also same to the application root folder with all permissions. Let me know what happens in the browser network tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM