Create a script for DebugDiag to analyze Managed WebExceptions

DebugDiag was originally designed to help IIS engineers find issues in IIS.  It does not have a very rich experience however when analyzing Managed Exceptions.  I will show you how to modify some existing scripts and use then to analyze issues with the HttpWebRequest class. First copy the existing script CrashHangAnalysis.asp to a file in…

0

How To: Modify injected (attributed) code in an ATL control that is crashing

(ATL Control Visual Studio 2003 Crashes long value) I found a problem in the injected code from Visual Studio 2003 for an ATL control that had a property that was a long (VT_I4) value.  You could reliably crash the control if you put it into an html page and had jscript in a loop, setting the…

0

Using .NET HttpWebRequest class with SiteMinder you get a 403 or 401 error

Download Fiddler from http://fiddlertool.com and run this for an Internet Explorer browser session that successfully connects.   Then hit the same site with your .NET 2.0 client application and make sure you set the credentials in your code as well: http://msdn.microsoft.com/en-us/library/system.net.networkcredential.aspx  (Note you can set myCreds directly on the Credentials property of the HttpWebRequest object……

0

The underlying connection was closed: An unexpected error occurred on a receive.

This article is a great help http://support.microsoft.com/kb/915599 however, there is another potential cause.  If the target server resets the connection without replying with an HTTP status (for example 200 OK) you can also get this error.  Solution, find out why the server is reseting the connection.  Common causes include the target of the HTTP traffic is…

0

Workaround For WinInet DNS not refreshing when using KB 263558

If you are making Synchronous calls in WinInet, the DNS timeouts don’t appear to work when set (see: http://support.microsoft.com/kb/263558 ). Async calls do however work correctly. One workaround is to simply restart the application using WinInet.  I found a code workaround for the issue as well.  Simply open and close the handle you get with the InternetOpen call…

1

Analyzing HttpWebRequest Connection Saturation in .NET

WinDbg is a powerful tool and can use the SOS extension (that ships with the .NET framework) to look into and analyze Managed Code.  Another powerful tool is Debug Diagnostics.  It uses the same Debugger Engine that WinDbg uses and can run analysis scripts.  You can use Debug Diagnostics and a custom script to analyze…

0

Print from Internet Explorer without the Printer Selection Box

Quickie post… If you have a default printer selected on your system, then this HTML page with jscript should print without showing the printer selection dialog (I will embellish this post later if I have time):   <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>   <html xmlns=”http://www.w3.org/1999/xhtml“> <head>     <title>Untitled Page</title>     <script language=’VBScript’>…

4

Stream a PDF file from a WebSite and don’t cache it client side

I had an issue where someone wanted to stream a file that was generated on the web server and prevent it from caching on the client.  The correct way to do this is to specify the Cache-Control: no-cache header.  When this was done however the pdf file did not display using https and on Windows…

0

A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive.

Your get one of these errors when running Internet Explorer:Stop running this script?A script on this page is causing Internet Explorer to run slowly.If it continues to run, your computer might become unresponsive. “A script on this page is causing Internet Explorer to run slowly.  If it continues to run, your computer may become unresponsive.”…

11

Troubleshooting code that uses the HTTP protocol

Overview You can solve issues encountered when using the HTTP protocol by applying the principles in this article.  By simplifying the issue into a small reproducible problem you can effectively troubleshoot and resolve most problems encountered in code that uses the HTTP protocol.  Crucial steps to troubleshooting code are: Gather Information, Simplify the Problem and…

4