开发者

Adding custom request header works for IIS 7.0 but not Asp.net dev server

开发者 https://www.devze.com 2023-03-11 18:35 出处:网络
We\'re tracking the total time it takes for a request to be responded to. We implemented added custom header: request.headers.add(\"reqKey\",key)

We're tracking the total time it takes for a request to be responded to. We implemented added custom header: request.headers.add("reqKey",key) with an unique key to the request in Application_AcquireRequestState of our 开发者_开发问答global.asax.cs.

When the Application_PostRequestHandlerExecute is hit for that request, it pulls the custom header with the unique key back out and uses that record the total response time. A bunch of other stuff is also logged with this, such as username, form data, etc., not just simple timings.

This currently works just fine when the code runs on IIS 7.5. However, when it's ran on an ASP.Net Development server, it throws a Operation is not supported on this platform exception.

Our Prod is IIS 7, so should how do I get around this error?


You can use IIS 7.5 Express if you are using VS2010 SP1. Download from here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=abc59783-89de-4adc-b770-0a720bb21deb

0

精彩评论

暂无评论...
验证码 换一张
取 消