How can a NT Service interfere with a Web Application navigating to a web page?
<p>Platform:
    Server 2008 R2
    .NET Framework 4.0
    IE 8 or 9</p>

<p>If the Web Application App Pool's Identity is the same as a NT service's account, the Web App does not work properly.  The account is a domian account with adminstrative privledges.  If the NT Service is stopped, the Web App works.  The NT Service is hosting a WCF Service.  The WCF service does nothing.  Below are 2 code snippets.  The 'URL' is correct but for some reason when the 'WebBrowser_DocumentCompleted' method looks for the 'ArchiveStatus' in the document, it is not there.  The web page is not the correct one.  </p>

<p>I don't understand how an NT Service can cause this problem.  I also have 2 other NT Services that have the same account.  If either of these are running, the same problem occurs.</p>

<pre><code>    public Bitmap GetHTMLSnapshot(string url, int width, int timeOut)
    {
       try
        {
            this._bmp = null;
            DateTime time = DateTime.Now;

            _WebBrowser = new WebBrowser();
            this._WebBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(WebBrowser_DocumentCompleted);
            this._WebBrowser.ScrollBarsEnabled = false;
            this._WebBrowser.Size = new Size(width + AppSettings("WidthAddjust", 20), this._WebBrowser.Size.Height);
            this._WebBrowser.ScriptErrorsSuppressed = true;

            this._WebBrowser.Navigate(url);

            while (this._bmp == null)
            {
                Sleep();
                TimeSpan elapsedTime = DateTime.Now - time;
                if (elapsedTime.Seconds &gt;= _TimeOut)
                {
                    System.Environment.Exit(HTMLSnapShotExe_ExitCode_TimeOut);
                }

            }
        }
        catch (Exception ex)
        {
            throw;
        }

        return this._bmp;
   }
</code></pre>

<hr>

<pre><code>   void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {

        try
        {
            WebBrowser webBrowser = (WebBrowser)sender;

            if (DetectHTTPError(webBrowser))
            {
                this._bmp = null;
            }
            else
            {
                var h1 = webBrowser.Document.Body.ScrollRectangle.Size.Height;
                var w1 = webBrowser.Document.Body.ScrollRectangle.Size.Width;
                webBrowser.ClientSize = new Size(w1, h1);
                webBrowser.ScrollBarsEnabled = false;
                Bitmap b = new Bitmap(webBrowser.Bounds.Width, webBrowser.Bounds.Height);

                System.Windows.Forms.HtmlDocument document = this._WebBrowser.Document;
                HtmlElement eArchiveSuccess = document.All["ArchiveStatus"];


                if (eArchiveSuccess != null)
                {
                    sArchiveStatus = eArchiveSuccess.GetAttribute("value");
                }

                webBrowser.BringToFront();
                webBrowser.DrawToBitmap(b, webBrowser.Bounds);
                this.TRACE("SnapShot grabbed");
                this._bmp = b;
            }
            webBrowser.Dispose();
        }
        catch (System.Exception ex)
        {
            throw;
        }
    }
</code></pre>
