Visual Studio 2019 Remote Debugging invalid working directory

EuroEager2008 171 Reputation points
2021-02-23T13:07:18.103+00:00

I have a console (.net 5.0) project which I want to remotely debug.
Remote machine is set up ok, remote debugger running without authentication requirements.
Build/Output path is set to a share on remote computer, build is ok (files are generated on output path.
Debug/Use remote machine is enabled and IP address set.
Debug/Working directory textbox is empty.
But when I start debugging a messagebox is popped up stating "Unable to start program <exe path on share>...<a local path> is not a valid working directory."

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
967 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Tianyu Sun-MSFT 29,446 Reputation points Microsoft Vendor
    2021-02-24T03:50:15.507+00:00

    Hi @EuroEager2008 ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    You need to make sure and keep the same path(for Debug folder) on your remote machine as on your Visual Studio computer. For example, the exe file locates on your remote computer under : <source path>\XXXX\XXXX\bin\Debug, then the same exe file locates on your Visual Studio computer should also under this directory: <source path>\XXXX\XXXX\bin\Debug.

    You can refer to the step 9 to step 10 of this document: Remote debug the project.

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

  2. EuroEager2008 171 Reputation points
    2021-05-24T12:06:00.82+00:00

    Thanks

    However, I think I found out that setting the Working Directory in the projec's properties Debug tab (and correct debug profile chosen) to a legal path on the remote machine is working fine (path is normally where exe and config files reside..

    This way, the path does not need to be identical with the VS machine

    0 comments No comments