global.asax で Application_Error メソッドを起動できません。Application_Error 関数の最初の行にブレークポイントを配置しましたが、そこでブレークすることはありません。代わりに、サーバーは通常の黄色の書式設定されたスタック トレース ページを返し、「ハンドルされていない例外が発生しました....」と言っているので、例外がスローされていることがわかります。
何かアドバイス?私は VS2010、C# 4.0 を使用しており、これを Dev Web サーバーで (F5 経由で) 実行しています。
Global.asax
void Application_Error(object sender, EventArgs e)
{
int i;
i = 3; <==BREAKPOINT SET HERE, NEVER HITS
}
web.config
<customErrors mode="Off" />
...
<compilation debug="true" targetFramework="4.0">
Application_Error がスキップされたときに表示されるページ:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Invalid column name 'JobTypeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'JobTypeID'.
Source Error:
Line 95:
Line 96: MyEntities context = Util.CurrentMasterContext();
Line 97: UserRec = context.User
Line 98: .Include("Person")
Line 99: .Include("AccountType")