locked
VS 2005 - Unable to attach to w3wp.exe (Managed) in Server 2008 RRS feed

  • Question

  • I'm running Windows Server 2008 RTM, trying to attach to w3wp.exe to debug managed code which is being called from ASP classic pages through COM+ interop.  (Please don't tell me about how I shouldn't be using ASP...it's really not my fault )

    When I try to connect, I get the following error message:

    Unable to attach to the process. Attaching to a process in a different terminal server session is not supported on this computer. Try remote debugging to the machine and running the Microsoft Visual Studio Remote Debugging Monitor in the process's session.

    I'm running IIS on my local box, which is my dev workstation.  I'm logged in as Administrator, and VS is running as Administrator.  I followed the advice in this thread:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?siteid=1&PostID=1829418

    and have noticed no change in the behavior.

    Thanks in advance for any help you can give me!
    Friday, February 15, 2008 9:18 PM

Answers

  • The first thing I should say is that that errer message ('Attaching to a process in a different terminal server session is not supported on this computer....') is completely wrong. What is actually happening is the the CLR debugging services are failing to attach to the process with E_ACCESSDENIED, and Visual Studio is incorrectly diagnosing why that is happening.

     

    So, why are you getting E_ACCESSDENIED?

     

    Well, there are two issues that we have found internally where the CLR debugging services can do this, and I suspect that you are running into one of them. Hopefully we can find you a work around.

     

    Can you try this:

    1) iisreset

    2) Create a new ASP.NET web site which is in the same app pool as your ASP clasic site.

    3) Hit a web page in the ASP.NET web site

    4) Attach a debugger to w3wp.exe

    5) Hit your web site and try to debug

     

    Gregg

    Thursday, February 21, 2008 10:33 PM

All replies

  • The first thing I should say is that that errer message ('Attaching to a process in a different terminal server session is not supported on this computer....') is completely wrong. What is actually happening is the the CLR debugging services are failing to attach to the process with E_ACCESSDENIED, and Visual Studio is incorrectly diagnosing why that is happening.

     

    So, why are you getting E_ACCESSDENIED?

     

    Well, there are two issues that we have found internally where the CLR debugging services can do this, and I suspect that you are running into one of them. Hopefully we can find you a work around.

     

    Can you try this:

    1) iisreset

    2) Create a new ASP.NET web site which is in the same app pool as your ASP clasic site.

    3) Hit a web page in the ASP.NET web site

    4) Attach a debugger to w3wp.exe

    5) Hit your web site and try to debug

     

    Gregg

    Thursday, February 21, 2008 10:33 PM
  • Gregg,

    Thank you for your reply.  I figured the error message was probably misleading.

    Your workaround did in fact work.  After IISreset and hitting an asp.net page first, Managed shows up as one of the domains for debugging.  When I initially hit an ASP page, Managed is not displayed as a domain.  After connecting to w3wp with the managed debugger, I am able to debug my C# code within the ASP app.  In addition, after disconnecting the debugger, Managed is still displayed as a domain, and I am able to reconnect without going through any other process.

    Thank you very much!

    -Matt
    Friday, February 22, 2008 6:51 AM
  • I am getting this same error when trying to debug an aspx page.
    I am hosting a site on a Windows 2008 Server (x64) and trying to browse to a page which is throwing one of those nasty object reference errors.
    I am trying to Remote debug from my local machine.  I have followed the steps in this post http://www.wictorwilen.se/Post/How-to-get-Remote-Debugging-work-properly.aspx.
    I am logged in to the server with the same credentials as I am loggedin on my localhost.
    When trying to attach to the w3wp.exe (only one is running), I am getting the above mentioned error.

    Any ideas?

    BTW, I tried an iisreset, and then loaded a page, but am still getting the error.

    Thanks in advance!
    • Proposed as answer by rlev Tuesday, August 25, 2009 5:22 PM
    Tuesday, August 25, 2009 3:40 PM
  • I finally figured out this problem. I was trying to remote debug where the server hosting the site was an x64 and I was running the x86 remote debugger monitor. I downloaded the x64 version from http://www.microsoft.com/downloads/details.aspx?FamilyID=440ec902-3260-4cdc-b11a-6a9070a2aaab&displaylang=en (installed to C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64) and ran the msvsmon.exe, and wala! I was able to attach to the process and debug. :)
    • Proposed as answer by rlev Tuesday, August 25, 2009 5:23 PM
    Tuesday, August 25, 2009 5:23 PM