Próbuję debugować obiekt obsługi protokołu HTTP Visual Studio, a punkt przerwania nie jest uzyskiwany. Czy ktoś ma pomysł na temat debugowania obsługi HTTP w Visual Studio?Debugowanie procedury obsługi protokołu HTTP z programu Visual Studio
Używam VS 2010 Premium, .NET 4.0 w systemie Windows 7maszynie. W mojej aplikacji sieci Web Mam Handler HTTP w /HTTPHandler/TrackingHandler.cs
Poniżej moim internetowej config plików:
<system.webServer>
<handlers>
<add name="TrackingHandler" path="/tx/*" verb="*" type="ProjectNamespace.TrackingHandler" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
My HTTP Handler wygląda poniżej
namespace ProjectNamespace
{
public class TrackingHandler : IHttpHandler
{
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
//Breakpoint on the very first line below
string tracker = Path.GetFileName(context.Request.PhysicalPath);
.......
}
}
}
Rozpoczynam moją aplikację internetową za pomocą dowolnej losowej strony w Visual Studio Debug przy użyciu wbudowanego serwera WWW . Następnie edytuję adres URL, aby wskazać katalog /tx/directory i losowy ciąg po nim. Dla np. mój bieżący adres URL wygląda tak: http: // localhost: 53699/tx/sdfs. Myślałem, że to powinno podnieść punkt przerwania w pierwszej linii ProcessRequest(), ale nie.
Byłbym wdzięczny za wszelkie pomysły.
O. O.
Edycja: Dodatkowe informacje
W właściwości projektu, w zakładce internetowej wybrałem Nie otwierać stronę. Zaczekaj na żądanie z aplikacji zewnętrznej. Byłem też coraz System.Web.HttpException, więc poszedłem do Debug -> Wyjątki -> Common Language Runtime i zaznaczone pole obok system.Web.
Oto mój ślad stosu. Wygląda na to, że nie dostanie się do mojego przewodnika. Czy zdefiniowałem to nieprawidłowo w moim Web config?
> System.Web.dll!System.Web.StaticFileHandler.GetFileInfo(string virtualPathWithPathInfo, string physicalPath, System.Web.HttpResponse response) + 0x1f7 bytes
System.Web.dll!System.Web.StaticFileHandler.ProcessRequestInternal(System.Web.HttpContext context = {System.Web.HttpContext}, string overrideVirtualPath) + 0xc7 bytes
System.Web.dll!System.Web.DefaultHttpHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback callback = {Method = {System.Reflection.RuntimeMethodInfo}}, object state = null) + 0x15c bytes
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x2d7 bytes
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0xb9 bytes
System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x13e bytes
System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0xf8 bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {Microsoft.VisualStudio.WebHost.Request}) + 0x1a2 bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x7d bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequest(System.Web.HttpWorkerRequest wr) + 0x47 bytes
WebDev.WebHost40.dll!Microsoft.VisualStudio.WebHost.Request.Process() + 0x17b bytes
WebDev.WebHost40.dll!Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Microsoft.VisualStudio.WebHost.Connection conn = {System.Runtime.Remoting.Proxies.__TransparentProxy}) + 0x6c bytes
[Appdomain Transition]
WebDev.WebHost40.dll!Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(object acceptedSocket) + 0x83 bytes
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state) + 0x2d bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xb0 bytes
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x5a bytes
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x147 bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() + 0x2d bytes
[Native to Managed Transition]
Dziękuję. Nie mogłem znaleźć ** aspnet_wp.exe ** na liście procesów. Próbowałem uruchomić go w VS za pomocą opcji _ "Nie otwieraj strony" _, jak wspomniano w edycji na moje oryginalne pytanie. Ze śladu stosu myślę, że nawet nie wchodzi w mój kod. Zawsze używam VS jako ** admin **. –
Dodatek AttachTo nie jest zgodny z VS.NET 2015 –