I have an application that makes a warning in IIS.
When I tried this in my own way visual studio, nothing happened. I did Application_Errorin global.asaxto catch unhanded exceptions.
Here is the information about this error:
Message: Server cannot set status after HTTP headers have been sent.
Source: System.Web.
InnerException: (none)
End of stacktrace:
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
How can I debug it?
When a user lands on a web application, if not session, he is redirectedfor the auth service, which is redirectalso a user in the web application, with a token in the URL for user authentication.
An error occurs during this process.
EDIT: maybe this code generates a warning
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
string token = Request.QueryString["token"];
if (!string.IsNullOrEmpty(token))
{
SessionManager.IdentityToken = token;
SessionManager.UserDatas.IdentityToken = token;
SSOInformations sso = SSOManager.GetSSO(new Guid(token), false);
if (sso != null)
{
SessionManager.UserDatas.loginID = sso.login;
catch (Exception ex)
{
TempData["ERROR_MESSAGE"] = ex.Message;
RedirectToAction("index", "error");
}
}
else
{
Response.Redirect(ConfigManager.AuthService);
return;
}
}
base.OnActionExecuting(filterContext);
}