From 6ae12fb8471928c8cd670d6ad1985f9f02de1dc0 Mon Sep 17 00:00:00 2001 From: yaananth Date: Thu, 21 Dec 2017 00:19:31 -0500 Subject: [PATCH 1/2] Add warning against using PreSendRequestHeaders For managed modules, adding more details w.r.t w3wp crashes --- .../what-not-to-do-in-aspnet-and-what-to-do-instead.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md b/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md index 513c735675..9797666913 100644 --- a/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md +++ b/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md @@ -199,7 +199,9 @@ The following example shows how to pass an encoded URL as a query string paramet Recommendation: Do not use these events with managed modules. Instead, write a native IIS module to perform the required task. See [Creating Native-Code HTTP Modules](https://msdn.microsoft.com/en-us/library/ms693629.aspx). -You can use the [PreSendRequestHeaders](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.presendrequestheaders.aspx) and [PreSendRequestContext](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.presendrequestcontent.aspx) events with native IIS modules, but do not use them with managed modules that implement IHttpModule. Setting these properties can cause issues with asynchronous requests. +You can use the [PreSendRequestHeaders](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.presendrequestheaders.aspx) and [PreSendRequestContext](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.presendrequestcontent.aspx) events with native IIS modules. +> [!WARNING] +> Do not use them with managed modules that implement IHttpModule. Setting these properties can cause issues with asynchronous requests. We have seen instances where the combination of Application Requested Routing(ARR) and websockets lead to access violation exceptions (iiscore!W3_CONTEXT_BASE::GetIsLastNotification+68 in iiscore.dll has caused an access violation exception (0xC0000005)) that lead to w3wp crash. From 6dbfdf987abce57bfb83f6ddd67378e8964f0912 Mon Sep 17 00:00:00 2001 From: Rick Anderson Date: Thu, 21 Dec 2017 13:44:27 -1000 Subject: [PATCH 2/2] Update what-not-to-do-in-aspnet-and-what-to-do-instead.md --- .../what-not-to-do-in-aspnet-and-what-to-do-instead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md b/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md index 9797666913..d9133315db 100644 --- a/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md +++ b/aspnet/aspnet/overview/web-development-best-practices/what-not-to-do-in-aspnet-and-what-to-do-instead.md @@ -201,7 +201,7 @@ Recommendation: Do not use these events with managed modules. Instead, write a n You can use the [PreSendRequestHeaders](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.presendrequestheaders.aspx) and [PreSendRequestContext](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.presendrequestcontent.aspx) events with native IIS modules. > [!WARNING] -> Do not use them with managed modules that implement IHttpModule. Setting these properties can cause issues with asynchronous requests. We have seen instances where the combination of Application Requested Routing(ARR) and websockets lead to access violation exceptions (iiscore!W3_CONTEXT_BASE::GetIsLastNotification+68 in iiscore.dll has caused an access violation exception (0xC0000005)) that lead to w3wp crash. +> Do not use `PreSendRequestHeaders` and PreSendRequestContext` with managed modules that implement `IHttpModule`. Setting these properties can cause issues with asynchronous requests. We have seen instances where the combination of Application Requested Routing(ARR) and websockets lead to access violation exceptions (iiscore!W3_CONTEXT_BASE::GetIsLastNotification+68 in iiscore.dll has caused an access violation exception (0xC0000005)) that lead to w3wp crashing.