How to set web.config file to show full error message (.net core 2.1)

krabcore picture krabcore · May 30, 2019 · Viewed 10.1k times · Source

I hosted my asp core app on iis (publish in folder method). tried to create my own web.config to see detailed error messages on client side. So I added web.config:

<configuration>
<system.web>
    <customErrors mode="Off" />
</system.web>
<system.webServer>
    <httpErrors errorMode="Detailed" />
</system.webServer>

After I restarted IIS nothing happens, clients still gets default error: enter image description here

Can I somehow get additional information about errors using web config?

Answer

krabcore picture krabcore · Jun 6, 2019

web.config

<system.webServer>
    <httpErrors errorMode="Detailed" />
    <aspNetCore processPath="dotnet">
        <environmentVariables>
            <environmentVariable name="ASPNETCORE_DETAILEDERRORS" value="true" />
        </environmentVariables>
    </aspNetCore>
</system.webServer>