title: visual studio error attaching debugger
body: <p>I just set up my machine to code Windows Azure apps in Visual Studio 2010. I have a machine at work, which works fine. The machines are both 64-bit Windows 7. I run as administator at work. At home I installed most of the VS and .NET components as normal user, but I'm running everything now as administrator, because I assume there could be some errors correlating to that.</p>
  
  <p>Creating a standard Azure project with one web role gives me this: </p>
  
  <blockquote>
    <p>"there was an error attaching the debugger to the IIS worker process
    for URL <code>http://127.0.0.1:5100/</code> for role instance 'xyz'...".</p>
  </blockquote>
  
  <p>I searched Google 24 hours and tried most of the solutions, but none worked for me:</p>
  
  <ul>
  <li>repairing .NET 4.0 (I didn't uninstall it prior to reinstalling, but
  I will try to do so now)</li>
  <li>setting the WebRole as Start Project works fine. It runs the webpage.</li>
  <li><code>&lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0" /&gt;</code> is set to true ( <a href="http://www.google.de/url?sa=t&amp;source=web&amp;cd=4&amp;sqi=2&amp;ved=0CDgQFjAD&amp;url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F4541593%2Fazure-error-on-starting-with-multiple-web-role-projects&amp;ei=RAhOTq27Fsv4sgaB_LSVAw&amp;usg=AFQjCNFa6NveaRmUhBtEIus9vwK54VojKA" rel="nofollow">http://www.google.de/url?sa=t&amp;source=web&amp;cd=4&amp;sqi=2&amp;ved=0CDgQFjAD&amp;url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F4541593%2Fazure-error-on-starting-with-multiple-web-role-projects&amp;ei=RAhOTq27Fsv4sgaB_LSVAw&amp;usg=AFQjCNFa6NveaRmUhBtEIus9vwK54VojKA</a>)</li>
  <li>there's no httpModules to delete ( <a href="http://natacha-huguet-millot.tumblr.com/" rel="nofollow">http://natacha-huguet-millot.tumblr.com/</a>)</li>
  <li>there's only one v4.x directory in Windows\Microsoft.NET\Framework64 ( <a href="http://social.technet.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/45e01c3d-7c16-4ca7-999b-46cb20b38c1d#0c118416-484a-413c-bd18-049033b1ccb8" rel="nofollow">http://social.technet.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/45e01c3d-7c16-4ca7-999b-46cb20b38c1d#0c118416-484a-413c-bd18-049033b1ccb8</a>)</li>
  <li>running aspnet_regiis.exe -r. succeeds but doesn't work ( <a href="http://www.dotnetspark.com/kb/3720-error-attaching-debugger-windows-azure-sdk.aspx" rel="nofollow">http://www.dotnetspark.com/kb/3720-error-attaching-debugger-windows-azure-sdk.aspx</a>) neither does rebooting</li>
  <li>looking for Visual Studio Web Debugger log shows this (also my section name="httpErrors" overrideModeDefault in IIS is set to Allow; source: <a href="http://dunnry.com/blog/2011/07/14/HowToDiagnoseWindowsAzureErrorAttachingDebuggerErrors.aspx" rel="nofollow">http://dunnry.com/blog/2011/07/14/HowToDiagnoseWindowsAzureErrorAttachingDebuggerErrors.aspx</a>): </li>
  </ul>
  
  <blockquote>
  <pre><code>http://127.0.0.1:5100/debugattach.aspx 
  Status code=403 (Forbidden) Protocol version=1.1 Cached=False
  Content-Length=53 Content-Type=text/html; charset=utf-8 
  Date=Fri, 19 Aug 2011 20:16:48 GMT Server=Microsoft-IIS/7.5
  X-Powered-By=ASP.NET
  /debugattach.aspx-application debugging not activated.
  </code></pre>
  </blockquote>
  
  <hr>
  
  <p>When I comment out the Sites-Tag in the ServiceDefinition.csdef I get the following error:</p>
  
  <blockquote>
    <p>"unrecognized attribute 'targetframework'. note that attribute names
    are case-sensitive"</p>
  </blockquote>
  
  <p>Here I also tried most solutions to be found on the internet:</p>
  
  <ul>
  <li>setting the right .NET-Framework version in IIS-Manager (all application pools are set to 4.0, when starting the project, the error page shows framework 2.0 though, where can I change it?)</li>
  <li>installing the newest .NET-Framework, I have 4.0.30319</li>
  </ul>
  
  <p>None of them work.</p>
  
  <p>If you have any advice, I will try it and list my result in this post.</p>