﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>RT-blog</title>
    <description>Thoughts on and experiences with computers, programming and electronics.</description>
    <link>http://www.realtechnology.com/RTBlog/tabid/59/BlogId/2/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>rtblog@realtechnology.com</managingEditor>
    <webMaster>ronsmith@realtechnology.com</webMaster>
    <pubDate>Mon, 06 Feb 2012 11:53:07 GMT</pubDate>
    <lastBuildDate>Mon, 06 Feb 2012 11:53:07 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.3.0.16726</generator>
    <item>
      <title>Visual Studio 2008: Unable to start debugging on web server. An authentication error occurred...</title>
      <description>&lt;p&gt;My dev server is a Win 2003 machine with IIS 6.0.  I've got a number of web sites set up which I reference via URLs such as &lt;a href="http://site1.localhost/"&gt;http://site1.localhost&lt;/a&gt;, &lt;a href="http://site2.localhost/"&gt;http://site2.localhost&lt;/a&gt;, etc.  By putting entries in my HOSTS file which point back to 127.0.0.1, I can use those URLs to access the sites because I set up Host Headers for each site to look for its specific URL.&lt;/p&gt;
&lt;p&gt;After installing VS 2008, I suddenly lost the ability to debug web applications on my local machine.  I had been using VS 2005 successfully before that.&lt;/p&gt;
&lt;p&gt;"Unable to start debugging on the web server. An authentication error occurred while communicating with the web server."&lt;/p&gt;
&lt;p&gt;I did a lot of fruitless searching on the web.  None of the solutions worked: Integrated Windows Authentication must be enabled for the website - yes it was. ASP.Net security settings all checked out.  ACL's were all okay.  I found that if I disabled Anonymous logins for the website in IIS, I could see that Integrated Windows Authentication wasn't working properly.  When viewing the site in my browser I would be asked to log in, but my windows credentials would not work*. Arg!&lt;/p&gt;
&lt;p&gt;After examining IIS log files, it was clear that Visual Studio was trying to log in to the web server using the same account I was logged into Windows with.  So we were both having the same problem. For some reason IIS wasn't handling IWA properly.&lt;/p&gt;
&lt;p&gt;I turned on auditing for logon failures and examined the security event log.&lt;/p&gt;
&lt;p&gt;Hmm, this is interesting:&lt;/p&gt;
&lt;p&gt;Event Type: Failure Audit&lt;br /&gt;
Event Source: Security&lt;br /&gt;
Event Category: Logon/Logoff &lt;br /&gt;
&lt;font style="background-color: #ff6600"&gt;Event ID: 537&lt;/font&gt;&lt;br /&gt;
Date:  1/8/2009&lt;br /&gt;
Time:  12:56:45 PM&lt;br /&gt;
User:  NT AUTHORITY\SYSTEM&lt;br /&gt;
Computer: ISIS&lt;br /&gt;
Description:&lt;br /&gt;
Logon Failure:&lt;br /&gt;
  Reason:  An error occurred during logon&lt;br /&gt;
  User Name: administrator&lt;br /&gt;
  Domain:  isis&lt;br /&gt;
  Logon Type: 3&lt;br /&gt;
  &lt;font style="background-color: #ff9900"&gt;Logon Process: ÈùÈ&lt;/font&gt;&lt;br /&gt;
  Authentication Package: NTLM&lt;br /&gt;
  Workstation Name: ISIS&lt;br /&gt;
  Status code: 0xC000006D&lt;br /&gt;
  Substatus code: 0x0&lt;br /&gt;
  Caller User Name: -&lt;br /&gt;
  Caller Domain: -&lt;br /&gt;
  Caller Logon ID: -&lt;br /&gt;
  Caller Process ID: -&lt;br /&gt;
  Transited Services: -&lt;br /&gt;
  Source Network Address: 127.0.0.1&lt;br /&gt;
  Source Port: 4869&lt;/p&gt;
&lt;p&gt;Well, no, it isn't that interesting, but the error code led me to this explanation:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://support.microsoft.com/kb/896861/en-us"&gt;You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or IIS 6&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As it turns out, Windows Server 2003 Service Pack 1 (SP1) has a loopback check security feature.  Since I was browsing locally and using host headers to access my websites, Windows was refusing to validate the request  (or something like that).&lt;/p&gt;
&lt;p&gt;After following the instructions for the workaround, VS debugging works fine now.  I felt I needed to connect the dots here because my initial searches didn't turn up this solution.&lt;/p&gt;
&lt;p&gt;*This had been a problem prior to intalling VS 2008, but I was able to work around it by enabling anonymous access to the websites.&lt;/p&gt;</description>
      <link>http://www.realtechnology.com/RTBlog/tabid/59/EntryID/27/Default.aspx</link>
      <author>rtblog@realtechnology.com</author>
      <comments>http://www.realtechnology.com/RTBlog/tabid/59/EntryID/27/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.realtechnology.com/Default.aspx?tabid=59&amp;EntryID=27</guid>
      <pubDate>Fri, 09 Jan 2009 00:10:10 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.realtechnology.com/DesktopModules/Blog/Trackback.aspx?id=27</trackback:ping>
    </item>
  </channel>
</rss>
