httpmodule

How to analyze the performance of requests in ASP.NET MVC application?

不羁岁月 提交于 2019-11-27 04:34:39
问题 I would like to capture the hit time, processing time, memory consumption and response time of requests in ASP.NET MVC application. Is there any way or tool to perform this? 回答1: Check the miniprofiler , developed by the stackoverflow team http://code.google.com/p/mvc-mini-profiler/ This helps you to do some analysis. There is a nuget pacakge available which you can use to add this to your project. Scott has written a post about how to use that. You can also look into Glimpse. There are

Help reading JSON from HttpContext.InputStream

半世苍凉 提交于 2019-11-27 04:08:12
问题 I have created a HttpModule to capture requests for auditing purposes. For Ajax requests to a web method I would like to also log the JSON data associated with the request. E.g Request POST /MyPage.aspx/AddRecord HTTP/1.1 x-requested-with: XMLHttpRequest Accept-Language: en-gb Referer: http://fiddlerlocal:5000/AddRecord.aspx Accept: application/json, text/javascript, / Content-Type: application/json; charset=utf-8 UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible;

IIS6 + HttpModule: This operation requires IIS integrated pipeline mode

送分小仙女□ 提交于 2019-11-27 03:11:26
问题 I am using IIS6, I've written an HttpModule, and I get this error? After googling the web I find that this problem is caused by the .NET framework 3.5, so I put this on a machine where I didn't install .NET 3.5, but the problem is still there! 回答1: My attempt at psychic debugging: you're using a statement like: Response.Headers("X-Foo") = "bar" If this is indeed the case, changing this as shown below will work around the problem: Response.AddHeader("X-Foo", "bar") 回答2: Only IIS7 supports the

What are some best practices for managing background threads in IIS?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 02:49:57
问题 I have written an HttpModule that spawns a background thread. I'm using the thread like a Scheduled Task that runs in-process, which is really handy. What are best practices for keeping track of this thread? I've never done this before, and I'm a little confused about some aspects of it: How do I know if the thread is still running? I see it do its job, but is there another way to know if it's still alive? I downloaded ProcMon, but w3wp.exe spawns a boatload of threads, so I had no idea which

HTTPModule Event Execution Order?

∥☆過路亽.° 提交于 2019-11-26 18:25:55
Does anyone know of a site or page, or know the order of execution for the events of the HTTPApplication class for HTTPModule event execution? I found the MSDN Documentation for all of the events, but it doesn't show a list of process steps and I haven't been able to find one. Maybe this helps http://support.microsoft.com/kb/307985/en-us/ An HttpApplication class provides a number of events with which modules can synchronize. The following events are available for modules to synchronize with on each request. These events are listed in sequential order: BeginRequest AuthenticateRequest

Can I access session state from an HTTPModule?

情到浓时终转凉″ 提交于 2019-11-26 10:14:18
I could really do with updating a user's session variables from within my HTTPModule, but from what I can see, it isn't possible. UPDATE: My code is currently running inside the OnBeginRequest () event handler. UPDATE: Following advice received so far, I tried adding this to the Init () routine in my HTTPModule: AddHandler context.PreRequestHandlerExecute, AddressOf OnPreRequestHandlerExecute But in my OnPreRequestHandlerExecute routine, the session state is still unavailable! Thanks, and apologies if I'm missing something! Jim Harte Found this over on the ASP.NET forums : using System; using

HTTPModule Event Execution Order?

不羁的心 提交于 2019-11-26 06:18:07
问题 Does anyone know of a site or page, or know the order of execution for the events of the HTTPApplication class for HTTPModule event execution? I found the MSDN Documentation for all of the events, but it doesn\'t show a list of process steps and I haven\'t been able to find one. 回答1: Maybe this helps http://support.microsoft.com/kb/307985/en-us/ An HttpApplication class provides a number of events with which modules can synchronize. The following events are available for modules to