Recipes‎ > ‎Programming‎ > ‎


DCOM got error, "Overlapped I/O operation is in progress"

(27Feb06)  This error is caused by strange permissions problems in IIS as it relates to the IUSR_[COMPNAME] and related accounts.  The principle symptom is a persistent 401 Unauthorized message received by web clients whenever they try to access an ASP page.  Static HTML pages may or may not be affected.  This illume article will show you a series of things to try.  Try them in any order, since they may or may not be useful in your case.

My computer configuration: Windows 2000 Server, SP4, default IIS 5.x install.  PHP pages work, static HTML pages work, ASP pages fail as described.

First, the script to know about is synciwam.vbs in the InetPub\AdminScripts directory.  Run it with cscript -i (? is it -v?) synciwam.vbs.  For me, this failed with an error number I don't remember offhand.

There's a setting in the registry: HKLM\System\CurrentControlSet\Control\LsaDefault.  This should be set to 0, but you can try setting it to 2 and then run the above script.  Restart, and try running synciwam again.  Note that you will receive exceedingly strange and mysterious errors if you leave this key at 0x2, so be sure to change it back.

In the IIS admin tool, under Directory Security > Edit (Anonymous access and authentication control), Edit, you can change the account information IIS uses to handle anonymous web requests.  This is normally IUSR_[computername], but you can change it and set the password here.  Note the checkbox, "Allow IIS to control password."  You should set this 'on' once everything is working.  If you change this information, synchronize it in your user accounts list.  As an aside, if you are having the aforementioned problem, valid administrative accounts don't avoid the password prompt completely!  This problem has to be solved, even on trusted networks.

If you make changes, be sure to promptly re-run synciwam.vbs, followed by resetiis (iisreset?).  Restart regularly, just for good measure.  Good luck!

The Specified Web Server Is Not Running ASP.NET Version 1.1

(27Feb06) This error can appear when you try to create a new web application in Microsoft Visual Studio 2003. Typical scenario involves an IIS-less installation of VisStudio, and then installing IIS afterwards.  The VisStudio installer sets up the .NET framework in IIS, and so there's a deadlock of sorts.  To solve, run the following:

C:\WINDOWS\Microsoft.NET\Framework\v1.1.xxxxx\aspnet_regiis.exe -i

Reading and Writing Text Files in VB.NET

    Imports System.IO

    Public Function GetFileContents(ByVal FullPath As String, _
        Optional ByRef ErrInfo As String = "") As String
        Dim strContents As String
        Dim objReader As StreamReader
            objReader = New StreamReader(FullPath)
            strContents = objReader.ReadToEnd()
            Return strContents
        Catch Ex As Exception
            ErrInfo = Ex.Message
        End Try
    End Function

    Public Function SaveTextToFile(ByVal strData As String, _
     ByVal FullPath As String, _
       Optional ByVal ErrInfo As String = "") As Boolean
        Dim Contents As String
        Dim bAns As Boolean = False
        Dim objReader As StreamWriter
            objReader = New StreamWriter(FullPath)
            bAns = True
        Catch Ex As Exception
            ErrInfo = Ex.Message
        End Try
        Return bAns
    End Function

Edit however you want