Welcome to MSDN Blogs Sign in | Join | Help

Fiddler – How to mimic a specific browser version request?

Fiddler tool doesn’t need any introduction, it is a great tool to debug a lot of client side issues with Internet Explorer, and other browsers as well <by setting the proxy to make the connections go through fiddler>. There are a few times when you have a different version of a browser, and you want to know what the server renders for different version of browser.

I was recently debugging an issue where the browser was giving few javascript errors on IE8, but not on compatibility view of IE8. In fact, the compatibility view of IE8 mimics the request as it is going from IE7. Did you know this before? Try taking a fiddler trace, and see what’s going on the wire. Examine the request section, and the request headers it sends.

Below code is very common:

// get browser version – pseudo code
var bVer = getBrowserVersion();
if(bVer == "IE6")
{
   // IE6 specific code
}
else if(bVer == "IE7")
{
   // IE7 specific code
}
// other version specific code

Above is a client side code which you can easily check by viewing the html source of the file on the client side. But, the same can be done on the server side, and its becomes trickier to find if such thing happen if you don’t have access to the server side code. You can simply try to mimic a request going from a different version of browser version, and see if the output html/javascript changes. If yes, then the server indeed seems to generate different scripts for different browser version. Probably they missed to put a check on the browser version you are in currently.

There are a plenty ways of generating a request of a specific browser version, and the easiest is just to choose from the Rules menu. Choose Rules –> User-Agents –> Select Version

 image

I’m on Windows 7 with IE8. Let me select to mimic the browser version to be IE 7(Vista). Below is the raw request you see in the Fiddler trace:

GET / HTTP/1.1
Accept: */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: www.bing.com

Other way of doing this is by using the Filters Tab which you will find it in the right hand side. I will probably write about the various things that you could perform using the Filters in a separate blog post. In fact, it would definitely need a series of posts. I will write them when I find time.

Posted by rakkim | 0 Comments
Filed under: ,

Blog update

ieYou might wonder why a big silence on this blog, I must admit that I was too busy to blog. Now, also working on a few IE related issues – on javascript, ActiveX, CSS, etc. You might find a few blogs related to those technologies as well, so I’m going to cover the most of the Microsoft’s web technology stack, both server, and the client side.


Stay tuned, more later! You can follow me on twitter @rakkimk

Posted by rakkim | 0 Comments
Filed under: ,

IIS – Getting “Connection_Abandoned_By_AppPool DefaultAppPool” – File Version Mismatch

Today, I was working with a customer of mine who had some problems in configuring a Virus Definitions Distribution Point for Symantec Live Update on IIS. Another module hosted on a different web-server has a button to test this distribution point, and we were seeing that the test on this Distribution Point was failing.

I’m no Symantec expert, and couldn’t understand what that test all about and what it was trying to do. Only after checking the IIS log file, we came to know that this test was trying to PUT some files to the server, and was not successful. Saw the below events in the HTTPERR log:

2009-08-07 18:54:36 <ip> 444 HTTP/1.1 PUT /virusdefs/minitri.flg - 783927 Connection_Abandoned_By_AppPool DefaultAppPool
2009-08-07 18:54:36 <ip> 444 HTTP/1.1 PUT /virusdefs/minitri.flg - 783927 Connection_Abandoned_By_AppPool DefaultAppPool

I know that we would get “Connection_Abandoned_By_AppPool DefaultAppPool” when the request was actually orphaned, or the application pool crashes. Check this KB for the explanations on each message you would see in HTTPERR logs.

Connection_Abandoned_By_AppPool - A worker process from the application pool has quit unexpectedly or orphaned a pending request by closing its handle.

But, we were sure that the worker process was not crashing, no event logs as such – as well as the PID of the w3wp.exe not changing. I just checked the file versions in the inetsrv folder, bingo! They were of older version than the SP version installed on the server. Probably the customer during the installation of IIS provided a Windows 2003 Server RTM CD instead of the one contains SP2 slip streamed. After re-applying the SP2 for Windows 2003 Server, issue was resolved. Take a look at this KB for more on this.

Take Away from this blog post: Mind to check the file versions, if you see a Connection_Abandoned_By_AppPool DefaultAppPool on the HTTPERR logs, and no event logs indicating a worker process crash.

Posted by rakkim | 0 Comments
Filed under: ,

IIS7 – Configure FREB rule to collect a dump

I wrote a post of my team blog where I explained how to configure FREB rule to collect dump when there is a slow running request (say request take more than 15 seconds to complete).

Read the complete post here.

Happy FREBing!

Posted by rakkim | 0 Comments
Filed under: , ,

IIS7 – To be noted while using Expression Encoder to upload large files to IIS server

Internet is full of videos, and you have a power packed set of tools for IIS to make media streaming top-notch experience. You have IIS Media Pack enabling intelligent progressive downloads, smooth streaming, throttling, etc. You have tools from Microsoft such as Expression Encoder which helps building rich videos. Expression Encoder also gives you an option to upload the videos from the tool itself directly to the web server.

I was working with one of my customer who was trying to upload a large file to the web server from his Expression Encoder, and failing with 404. While checking the IIS logs, found that it was really a 404.13 which says the content length is too large.

You should follow this KB to increase the maxAllowedContentLength to be able to satisfy the size of the file you are trying to upload. By default, it is just 28.6 MB. So, if you are uploading any file greater than 28.6 MB, it will fail.

This applies for any file you might try to upload, for example using the ASP.NET File Upload control. Thought I would just make this quick post for those who use Videos heavily, and upload them from the Video Editing tool (such as Expression Encoder) to the web server directly.

Posted by rakkim | 0 Comments
Filed under: ,

IIS7 – Improving ASP.NET performance (concurrent requests) while on Integrated Mode

If you were a ASP.NET 1.1 developer, and faced some performance problems, I’m sure you would have come across the KB 821268 which talks about tweaking maxWorkerThreads, maxIoThreads in the <processModel>, minFreeThreads, minLocalRequestFreeThreads in <httpRuntime>, maxconnection in the <connectionManagement> section. But for ASP.NET 2.0, we have <processModel autoConfig=”true” /> where these settings are tweaked in the runtime.

You may experience a performance issue while running your ASP.NET applications on IIS7 integrated mode. You might want to consider tweaking the number of concurrent requests per CPU on the server which can slow down the execution of the requests, and you will see few requests just waiting to be processed. By default, it sets a limit of 12 concurrent requests, and you can tweak the number by considering the below options registry key, or a equivalent configuration change if you have .NET 3.5 SP1:

[DWORD]

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727\MaxConcurrentRequestsPerCPU

Set this to a value higher than 12 (12 is the default)

If you already have SP1 for .NET 3.5 installed, this can be done via configuration itself:

Change the below in aspnet.config file (found in the framework folder)

<system.web>
      <applicationPool maxConcurrentRequestsPerCPU="12" maxConcurrentThreadsPerCPU="0" requestQueueLimit="5000"/>
</system.web>

Thomas Marquart has explained about the changes in the IIS7 thread handling (integrated mode) in his blog. That’s a well written blog explaining how the ASP.NET threading model in IIS6/IIS7 handles the requests. Please read!

Posted by rakkim | 0 Comments
Filed under: , ,

IIS7 – Configuring iisClientCertificateMappingAuthentication using appcmd

As you know there is no UI to configure iisClientCertificateMappingAuthentication in IIS7, it takes a little more time to configure the site for the same. Here is an article in the iis.net site which explains the steps one by one.

Configuring One-to-One Client Certificate Mappings
http://learn.iis.net/page.aspx/478/configuring-one-to-one-client-certificate-mappings/

You can also use Ulad’s VBScript to configure the mapping of the certificate, and the user credentials. I was working with one of my colleague who was trying to automate this configuration. One interesting thing to note here is these one-to-one certificate configurations MUST be present in the website level. So, if you want only your virtual directory to be using this iisClientCertificateMappingAuthentication, you need to specify the certificate-useraccount mapping configurations on the website level, and set the iisClientCertificateMappingAuthentication not enabled. And, just enable the iisClientCertificateMappingAuthentication only on the virtual directory (or application) level.

Below are the appcmd commands needed for the same (after configuring the one-to-one configuration using Ulad’s VBScript):

In this example, we will configure the IIS client certificate authentication only on the Virtual Directory level:

// disable the IIS client certificate authentication at the website level (our website is “Default Web Site”, and Vdir is “Myapplication”)

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/iisClientCertificateMappingAuthentication /enabled:false /commit:appHost

// disable anonymous authentication on the virtual directory

appcmd.exe set config "Default Web Site/Myapplication" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:false /commit:appHost

// disable windows authentication on the virtual directory

appcmd.exe set config “Default Web Site/Myapplication" -section:system.webServer/security/authentication/windowsAuthentication /enabled:false /commit:appHost

// enable iisClientCertificateMappingAuthentication, and oneToOneCertificateMappingsEnabled for the virtual directory

appcmd.exe set config "Default Web Site/Myapplication" -section:system.webServer/security/authentication/iisClientCertificateMappingAuthentication /enabled:true /oneToOneCertificateMappingsEnabled:true /commit:appHost

// set the SSL flags to require Client Certificates from the client connections

appcmd.exe set config "Default Web Site/Myapplication" -section:system.webServer/security/access /sslFlags:"Ssl, SslNegotiateCert, SslRequireCert"  /commit:apphost

Hope this helps!

Posted by rakkim | 0 Comments
Filed under: ,

FREB – Troubleshooting a simple error message

I just wrote a blog post on my team blog on using FREB to troubleshoot a simple error message. I’ve taken an example of a HttpModule setting the Response status to 400. This is not a common scenario, but I just want people to use FREB extensively in their troubleshooting an error message – to see which module set the status, and take it from there.

Read the post here - http://blogs.msdn.com/webtopics/archive/2009/06/12/troubleshooting-a-simple-error-message-using-freb.aspx

And, please do subscribe to my team blog RSS feed where we have bunch of folks blogging on issues which are most common to our customers, best practices, known issues, and workarounds, etc. That’s our official team blog of Microsoft IIS and ASP.NET support team.

Hope this helps!

Posted by rakkim | 0 Comments
Filed under: ,

URLScan – rejecting the request depending on the User-Agent string

I just learned this now :-) You can now use the URLScan 3.1 with your own custom rules, and it would come handy in situations like rejecting a request based on the User-Agent string.

Below is a sample rule for the same:

[Options]

RuleList=DenyUserAgent

 

[DenyUserAgent]

DenyDataSection=Agent Strings

ScanHeaders=User-Agent

 

[Agent Strings]

My Custom User-Agent String

Useful links

     http://learn.iis.net/page.aspx/476/common-urlscan-scenarios/

     http://blogs.iis.net/nazim/archive/2008/06/30/urlscan-v3-0-filtering-based-on-request-entity.aspx

     http://learn.iis.net/page.aspx/473/using-urlscan?info=EXLINK

Hope this helps!

Posted by rakkim | 5 Comments
Filed under:

IIS7 – Improved Backup Restore Tool, and a UI Module

NOTE : Before you even read about this module, I want to mention that I do not work for IIS product team at Microsoft, but in Product Support for IIS and ASP.NET. This module/application is purely out of my interest, and this is not an official release by Microsoft and hence NOT supported by Microsoft Services.

When I wrote my BackupRestore module UI module a while back, many people asked for few modifications, with the ability to take a complete backup of all the IIS configurations – because some of the IIS configurations can now lie within the individual web.configs of the applications. I was just waiting for some free time to do this. Since many of the users of this module have requested this feature for a while now, and I thought I would give a shot (and I wrote this while on vacation – that’s another story).

This is how it looks right now, and I’ve compiled a separate Windows Forms application as well – so if you do not want to put this module inside your IIS manager, you can use the Windows Forms Application version.

  image

Now, I’ve a checkbox which is selected by default which says the tool to collect the individual web.configs of the applications too. It generates the below files / folders inside the backup directory:

      • filelist.xml
      • webconfigfiles <folder>
      • other main config files and folders

So, the 1st 2 entries are the only difference between the backups taken using my previous module or APPCMD. filelist.xml is a file where I store all my backup files path (eg: path to the web.config of the website1), and it’s corresponding file in the <webconfigfiles> folder. This folder contains files in the name of 1.config, 2.config, etc which are the real web.config files of the applications.

Download Location

     IIS7 (7.5) manager UI module

    Windows Forms Application (stand alone EXE) (run with elevated permissions)

To use the IIS7 manager UI module, please follow the instructions in my older blog, but with the new DLL. I will soon add it to the iis.net/downloads under my user ID. If you have suggestions to improve this tool, please do leave a comment.

So, go ahead and grab the tool, and use it. Happy Backup-Restoring!

Posted by rakkim | 3 Comments
Filed under:

IIS7 - Getting HTTP 500.19 while accessing the website

I recently worked with one of my customer who was getting “HTTP 500.19” error while browsing the website.

Server Error in Application "application name"
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x8007000d
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

Err tool showed “STIERR_INVALID_HW_TYPE” for 0x8007000d error code.

With further troubleshooting found that he had a virtual directory configured for a UNC share, and had a wrong password mentioned. Entered the proper credentials, and the problem went away.

This error message is a generic error message which would occur when the site configuration data present in the applicationHost.config has a malformed entry, or not a valid data (in our case it was the wrong password for the UNC connection, and the IIS cannot read its web.config file to check if there is any system.webserver setting mentioned)

Related KB : http://support.microsoft.com/kb/942055

Posted by rakkim | 2 Comments
Filed under:

IIS7 Tweet #2: Modifying an existing binding for the website

appcmd.exe set config  -section:system.applicationHost/sites /[name='Default Web Site'].bindings.[protocol='http',bindingInformation='*:80:'].bindingInformation:"*:80:www.test.com"  /commit:apphost

Posted by rakkim | 0 Comments
Filed under: ,

IIS7 Tweet #1 : Setting UploadReadAheadSize

appcmd.exe set config  -section:system.webServer/serverRuntime /uploadReadAheadSize:"491521"  /commit:apphost

Posted by rakkim | 1 Comments
Filed under: ,

Problems with rendering the "Design" View for a simple asp.net website from Visual Studio 2008

I recently worked with one of my customer who when clicking on the "Design" view of an ASPX page, the designer window doesn't appear - blank page appears. And if you minimize the VS window, and maximize it again - we will see the desktop background in the place of the Designer surface.

Verified that neither the "Microsoft Visual Studio Web Authoring Component" nor "Microsoft Web Designer tools" was installed on the machine (Control panel --> Add/Remove window components).

Ran the file [Path to the Installation DVD]\WCU\WebDesignerCore\WebDesignerCore.EXE

NOTE  :  This exe doesn't have a UI, so watch the Task Manager to know when this exe completes its installation.

Reference : http://forums.asp.net/t/1167590.aspx

Keywords : Visual Studio 2008 blank Design View hang

Posted by rakkim | 2 Comments
Filed under: , ,

ASP.NET - AJAX functionality not working on the page | Getting ‘Sys’ is undefined

When the ASP.NET AJAX Functionality is not working on a web page, it is usually due to the fact that the javascript needed for AJAX is not sent to the client from the server for some reason.

‘Sys’ is undefined. You might see this error message when there is a problem with the client in receiving the javascript sent by the server for the AJAX functionality. Some browser might not show an alert of this error message, and you might see the status bar saying done, but in yellow. Yellow always indicates that you have an error occurred while the page was getting loaded.

clip_image002

And, when you double click on the status bar, you will see the below window depending on the version of IE you are running:

clip_image004

Internet Explorer 8

clip_image006

Internet Explorer 7

Let’s go ahead, and look at the line of script reported in the error by opening up the HTML source(right click in the browser and choose view source) sent by the server to the client, and see what’s present at the line number 47, and char 1. You will see the below:

Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));
Interestingly this is not something which you wrote yourself on the page, but this is added at the runtime by the ASPX handler which served your page, and this is done by the server side ScriptManager you have in your ASPX page.

If you search for ‘Sys’ in your HTML source, you might not find it. Because this is something which is sent to the client from a different file which is included in the HTML source. You might see the below (with a different value for the query string d) in the page:

<script src="/AJAXTimer/ScriptResource.axd?d=9tk5luWIQHpRBi2jvaLA3ovu_ryV3iBlv84cuaA3MT--_
            e3q9KdLubgmmRoMp9ixegSpkyQ0LFGM_KxDw2qwSneq8GS2D1TcTOujL7Q85DE1&amp;t=556b0a58" 
            type="text/javascript"></script>
So, a request to ScriptResource.axd is made in the runtime, and this is the file where all your javascripts required for your AJAX functionality to work and would be sent to the client as the response.

Let’s now see how to troubleshoot this problem we are facing. First thing to check is the IIS logs where all the requests with the corresponding response status would be logged. Below is the corresponding log for ScriptResource.axd on the server.

2009-02-26 21:00:28 W3SVC1 GET /AJAXTimer/ScriptResource.axd d=9tk5luWIQHpRBi2jvaLA3ovu_ryV3iBlv84cuaA3MT--_e3q9KdLubgmmRoMp9ixB0N1se3B9f-x_KQriM4xUb90HPABW5aUQb_PG3gbAH41&t=556b0a58 80 - 65.52.22.253 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322) royalchallenger 404 0 2 1405 567 15

So, we know for sure that the server is sending a HTTP 404 (Page not found) for the AXD request. Below are some possible reasons why a 404 might be sent from the server:

  1. File doesn’t exist on the server
  2. There is no ISAPI extension configured to serve this request
  3. An ISAPI filter plugged in the request pipeline sends a 404 for some reason
  4. URLScan rules might prevent it
  5. “Verify that file exist” is selected for the ISAPI extension configured to serve the request
  6. ISAPI Extension configured for the request (.axd in this example),is a prohibited web service extension

If you are running IIS7 (and above), you should consider using FREB for 404 errors, and from the logs you will be able to know which module is setting the 404.

If you check if there is a file named ScriptResource.axd is present in the website folder, I’m sure you will be surprised to see none. Because, ScriptResource.axd is a file which would be generated by the ASP.NET runtime on the fly, and would be sent to the client.

In one of plenty issues I’ve worked on AJAX, my customer was having a wild card ISAPI extension which on sight was advised for removal by me as a troubleshooting step, but only after taking a backup of IIS configuration. After removing the ISAPI extension, it started working – AJAX scripts are been sent to the client without any problem.

But the ISAPI extension which my customer had seemed to allow the ASPX requests to be processed by aspnet_isapi.dll, but it wasn’t allowing .AXD requests. It was the “Verify that file exists” causing the trouble because there is no physical file called ScriptResource.axd.

clip_image002[4]

If you are running into this problem, I would like you to check for the below things on the server.

  • Check if .axd requests are mapped to the aspnet_isapi.dll
    • In IIS6, you can check this in the Website properties --> Home Directory --> Configuration
    • In IIS7, you can check this in Website Features View --> Handler Mappings
  • Check if the web.config file has handler mappings added
    • In IIS6 or (IIS7 classic mode), you might need to place this under <system.web/httpHandlers>
    • In IIS7 (integrated mode), you might need to place this under <system.webServer/handlers>
<add verb="GET,HEAD" path="ScriptResource.axd" 
   type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0,
         Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />

You might also want to check this blog by Scott where he explains about xhtmlConformance, and problems of it with AJAX. You can choose to remove that line from the web.config, or can set the mode to “Transitional” instead of “Legacy”.

Posted by rakkim | 1 Comments
Filed under: , ,
More Posts Next page »
 
Page view tracker