私はMVC2を使用しています。
私のwebconfigは言う
<customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/internal-server-error">
<error statusCode="500" redirect="~/internal-server-error" />
<error statusCode="404" redirect="~/not-found" />
</customErrors>
私のテスト方法は言う
public ActionResult ErrorTest()
{
var z = 0;
var x= 3/z;
return null;
}
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
カスタムエラーメソッドの代わりに、デフォルトのランタイムエラーが発生します。これは呼び出されません。
なんで?これは開発サーバーの問題ですか?IISで動作しますか?
Application_Error
編集:IIS Expressでも試してみましたが、全体をコメントアウトしましたがGlobal.asax.cs
、まだ機能していません。