From ed85f504d8da633202b3fec5fdf11e8d6153d447 Mon Sep 17 00:00:00 2001 From: Chris R Date: Wed, 25 May 2016 10:39:52 -0700 Subject: [PATCH] #102 Filter out DEBUG requests under the debugger. --- .../IISMiddleware.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs index 96c2e458d9..b971223db1 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Diagnostics; using System.Globalization; using System.Security.Principal; using System.Threading.Tasks; @@ -61,6 +62,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration return; } + if (Debugger.IsAttached && string.Equals("DEBUG", httpContext.Request.Method, StringComparison.OrdinalIgnoreCase)) + { + // The Visual Studio debugger tooling sends a DEBUG request to make IIS & AspNetCoreModule launch the process + // so the debugger can attach. Filter out this request from the app. + return; + } + if (_options.ForwardClientCertificate) { var header = httpContext.Request.Headers[MSAspNetCoreClientCert];