アプリケーション用にカスタム エラー ページを設定しました。
<customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx"
/>
Global.asax の Application_Error() では、次のコードが機能して例外の詳細を取得します。
Exception ex = Server.GetLastError();
if (ex != null)
{
if (ex.GetBaseException() != null)
ex = ex.GetBaseException();
}
エラー ページ (~/errors/GeneralError.aspx.cs) に到達するまでに、Server.GetLastError() は null です
Global.asax.cs ではなく、エラー ページで例外の詳細を取得する方法はありますか?
Vista/IIS7 上の ASP.NET 3.5