none
Error while attempting to remote debug, error 0x80004002

    Question

  • When I attempt to remotely debug any windows forms application I get an error which says:

     "Error while trying to run project: Unable to start the program '{path of exe file}"'.
      An error occurred that usually indicates a corrupt installation (code 0x80004002). If the problem persists, repair your Visual Studio onstallation via 'Add or Remove Programs' in controll Panel."

    When I saw this the first thign I did is a repair on visual studio. That didn't solve the problem

    When I attempt to attach to a running process I get an almost identical error except that it says it is unable to attach instead of unable to run.

    The executable will debug locally and it will run outside of the debugger on both systems.

    A search for this error turned up several issues with this same error but they were all related to debugging mobile applications. That is not my situation; both systems are Windows XP w/ SP3 and both have .Net 3.5 installed.

    For security reasons, the app must be run on the remote computer in order to work.

    Any pointers would be apreciated.
    Wednesday, October 21, 2009 8:43 PM

Answers

  • In order to solve this problem, I just had to install the latest version of the Visual Studio 2008 Service Pack 1 Remote Debugger (on the server)
    It seemd the assembly were not same version on the developer machine and on the remote server.

    (http://www.microsoft.com/downloads/details.aspx?FamilyID=440ec902-3260-4cdc-b11a-6a9070a2aaab&displaylang=en)
    Friday, January 15, 2010 2:39 PM
  • VS is 9.0.30729.1
    .Net is 3.5 SP1

    However, I did fix the problem.

    All of the articles and forum posts I found with this error message were related to debugging on mobile devices and the most common issue seemed to be an incompatibility between DLLs in CE vs. the ones in XP/Vista. The exact issue people seemed to have didn't apply, but based on that I scoured the DLLs on the two computers looking for differences.

    I started with using depends on a simple app that had the problem (a blank "Windows Forms Application" template with only the build directory and remote debug setting changed); I found no differences. Then I decided to check .Net itself even though both computers reported having the same version installed. Here I found that several files in %windir%\Microsoft.Net\Framework were a different size and had different modified dates.

    SOLUTION (I did this each computer):

    1) Disable any .Net program that runs at startup or at logon (remember to set services to an option other than "Automatic")
    2) Restart the Computer
    3) Deleted the %windir%\Microsoft.Net\Framework folder. (this just makes step 4 much faster)
    4) Ran the .Net Cleanup Wizard, available here: http://go.microsoft.com/fwlink/?LinkID=121918
    5) Installed .Net 3.5 with SP1, available here: http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
        (Note: that the download link on that page will download a bootstrapper only but farther down there is a link labled as "Full Package")
    6) Installed all non-beta .Net updates available at http://update.microsoft.com/microsoftupdate
    7) Restore any programs disabled in step 1.

    I don't know that the full cleanup and reinstall was necisary but it did work.

    Jacob
    • Marked as answer by Jacob Wagner Thursday, October 22, 2009 2:19 PM
    Thursday, October 22, 2009 2:19 PM

All replies

  • Hello wagnerjp

    Could you please tell me the version of Visual Studio on your side? Please also confirm that you have installed the latest service pack of VS.

    I queried my support database and found several relevant reports. However all these reports said that the problem had been fixed. So I wonder your VS version.

    Regards,
    Jialiang Ge
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, October 22, 2009 7:47 AM
  • VS is 9.0.30729.1
    .Net is 3.5 SP1

    However, I did fix the problem.

    All of the articles and forum posts I found with this error message were related to debugging on mobile devices and the most common issue seemed to be an incompatibility between DLLs in CE vs. the ones in XP/Vista. The exact issue people seemed to have didn't apply, but based on that I scoured the DLLs on the two computers looking for differences.

    I started with using depends on a simple app that had the problem (a blank "Windows Forms Application" template with only the build directory and remote debug setting changed); I found no differences. Then I decided to check .Net itself even though both computers reported having the same version installed. Here I found that several files in %windir%\Microsoft.Net\Framework were a different size and had different modified dates.

    SOLUTION (I did this each computer):

    1) Disable any .Net program that runs at startup or at logon (remember to set services to an option other than "Automatic")
    2) Restart the Computer
    3) Deleted the %windir%\Microsoft.Net\Framework folder. (this just makes step 4 much faster)
    4) Ran the .Net Cleanup Wizard, available here: http://go.microsoft.com/fwlink/?LinkID=121918
    5) Installed .Net 3.5 with SP1, available here: http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
        (Note: that the download link on that page will download a bootstrapper only but farther down there is a link labled as "Full Package")
    6) Installed all non-beta .Net updates available at http://update.microsoft.com/microsoftupdate
    7) Restore any programs disabled in step 1.

    I don't know that the full cleanup and reinstall was necisary but it did work.

    Jacob
    • Marked as answer by Jacob Wagner Thursday, October 22, 2009 2:19 PM
    Thursday, October 22, 2009 2:19 PM
  • Glad to know that you have found the solution. Thanks for the sharing.

    Regards,
    Jialiang Ge
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, October 22, 2009 2:46 PM
  • In order to solve this problem, I just had to install the latest version of the Visual Studio 2008 Service Pack 1 Remote Debugger (on the server)
    It seemd the assembly were not same version on the developer machine and on the remote server.

    (http://www.microsoft.com/downloads/details.aspx?FamilyID=440ec902-3260-4cdc-b11a-6a9070a2aaab&displaylang=en)
    Friday, January 15, 2010 2:39 PM