、私はデバッグ=偽とcompilerOptions = "/デバッグを持っています:pdbonly "を使用してコンパイルしても、スタックトレースに行番号が表示されます。これは大部分は機能しますが、私はApp_Codeフォルダの関数にバグがあり、スタックトレースはエラーがエラーではない行にあると言いました。スタックトレース行番号がデバッグ=偽とcompilerOptions =と間違っている「/デバッグ:pdbonly」私はweb.configファイルではasp.net 3.5</p> <p>を使用しています
私はweb.configの設定をちょっと試してみましたが、debug = trueとcompilerOptions = pdbonlyを設定すると、バグのある行の直後にエラーが表示されます。 compilerOptions = pdbonlyを削除すると、スタックトレースは正しい行をエラーとして報告します。
//the actual bug (only reported when debug=true and no compiler options set)
var dt = new DateTime(-1,-1,-1);
//
//...lots of non-buggy code between
//
//the bug according to the stack trace when
// debug=false and compilerOptions="/debug:pdbonly"
var ts = TimeSpan.Empty;
この作業を正しく行う方法はありますか?