Stack trace in website project when debug = false

We have a website project. We register unused exceptions with an application-level exception handler.

When we set debug = true in the web.config file, the exception log shows the line numbers of the violation in the stack trace.

But when we set debug = false, in web.config the log does not display line numbers.

We are currently unable to convert a website project into a webapplication project type. Its legacy application and almost all of the code are on aspx pages. We also need to leave the project in "updated" mode. Those. we cannot precompile. We generate pdb files.

Is there anyway to say such website designs for creating pdb files and show line numbers in the stack trace?

+3
source share
1 answer

Add compilerOptions="/debug:pdbonly"as an attribute <compiler>to your web.config file:

    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp"  compilerOptions="/debug:pdbonly" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler><!-- removed vb.net stuff -->
        </compilers>
    </system.codedom>

Here's more information about setting compiler options in ASP.NET: http://msdn.microsoft.com/en-us/library/a15ebt6c.aspx

+4
source

Source: https://habr.com/ru/post/1746183/


All Articles