0

I added the following to all the web.configs in my app. But I still can't see the errors remotely. How could this be?

 <configuration>
 <system.web>
  <customErrors mode="Off"/>
</system.web>
</configuration>
chriga
  • 798
  • 2
  • 12
  • 29

2 Answers2

1

the reason is, you need to set debug to true:

<configuration>
    <system.web>
        <compilation debug="true" />
        <customErrors mode="Off"/>
    </system.web>
</configuration>

customErrors mode is meant for debugging purposes and won't work once deployed to the server unless you set compilation debug="true".

Barr J
  • 10,636
  • 1
  • 28
  • 46
0

I had an issue seeing the yellow screen of death, too. So, instead I sent the output of the exception to a log file by setting stdoutLogEnabled="true" and stdoutLogFile="C:\Users\SomeUser\LoggingDirectory\LogFileName". In this case, you'll get a log file named something like LogFileName_20220607193533_9648.txt.

BE SURE TO RESET IIS.

<configuration>
  <system.web>
    <customErrors mode="Off" />
  </system.web>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\Project.Name.dll" stdoutLogEnabled="true" stdoutLogFile="C:\Users\SomeUser\LoggingDirectory\LogFileName" hostingModel="OutOfProcess" />
    </system.webServer>
  </location>
</configuration>

Disclaimer: I'm not certain that you need the "customErrors mode='Off'" part but, it was there when this solution worked for me.

Tangere Apps
  • 216
  • 4
  • 5