Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The working directory does not exist

I am using Visual Studio 2010.

I wanted to study some code that dumps relevant data in a database, find out how it works and adapt it to my own version.

I only got as far as loading the solution in VS 2010, hitting the "Start Debugging" button, and then I got this error:

The working directory does not exist:
'D:\Dev\CodeProject\articles\smartcardfmwk\Smartcard_Framework

How can I fix this error?

The source code in question is Smart Card Framework, from Code Project

I downloaded the "Updated Project (VS2010)" and I can open it in VS2010, as well as build, but debugging just wouldn't work.

I did not try replicating the path yet, but as this is a working project, my company requires that it is placed on a very specific location accessible by others.

like image 474
zack_falcon Avatar asked Jul 15 '13 03:07

zack_falcon


People also ask

Can start process working directory does not exist?

It happens because when you create a file it automatically assigns the working directory to it's configuration, which of course is the one where you created it. You can change that by going into Run -> Edit Configurations . Click on the folder icon in Script path: and correct the path to the file.

Which is the working directory?

In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just current directory.

How do I find my work directory?

While in Windows Explorer, the current working directory is shown at the top of the Explorer window in a file address bar. For example, if you were in the System32 folder, you would see "C:\Windows\System32" or "Computer > C:>Windows\System32" depending on your version of Windows.


2 Answers

Nevermind, I got it. It was so simple, I'm sorry for wasting anyone's time.

The source Solution had a lot of Projects under them. I figured at least one of them was pointing to a directory that doesn't exist, so I waded through the Projects,

  • I right-clicked a Project and clicked the Properties
  • This will open up the ProjectName Property Tab
  • Under the Debug tab, there is a filed called "Working Directory"; I changed it to where the project is currently located.

This solved my problem, for now, unless there's a Project I missed. I am wondering, though, if I have to do this again if I move the Solution elsewhere.

like image 102
zack_falcon Avatar answered Sep 19 '22 13:09

zack_falcon


This happened also in VS 2019 after importing / upgrading an old C# project. I was not able to see any project properties to change. Finally it was fixed by manually editing the file <ProjName>.user.csproj as follows:

Replace

<StartWorkingDirectory>[wrong directory name]</StartWorkingDirectory>

with

<StartWorkingDirectory>.\</StartWorkingDirectory>
like image 28
user3076105 Avatar answered Sep 20 '22 13:09

user3076105