私はHTTP 302リダイレクトをしようとしていますが、デバッグモードで実行している間は次の例外が発生します。HTTPリダイレクト302
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
var response = HttpContext.Current.Response;
response.Clear();
response.Status = "302 Found";
response.AddHeader("Location", "http://google.com");
response.End();
response.Flush();
かいつまんで、この呼び出しは、応答をフラッシュしないと、リダイレクトされていません。
どうすればこの問題を解決できますか?
あなたのアプリをデバッグモードでコンパイルして実行していたのですか、リリースモードでアプリをコンパイルしてそのプロセスにデバッガを接続するだけでしたか? – Icarus
こちらもご覧くださいhttp://automagical.rationalmind.net/2010/03/08/response-redirect-and-302-and-301-status-codes/ –